~/.p4enviro in ubuntu Permission denied - ubuntu-18.04

When I try and run ~/.p4enviro in Ubuntu
I get the following message: Permission denied
I have tried logging is as toot but that didn't help.

~/.p4enviro isn't an executable. The permission error is because it doesn't have the +x permission bit set. You can set it with chmod +x ~/.p4enviro but it still won't do anything useful when you try to run it.
The P4ENVIRO file (default ~/.p4enviro) is used as a configuration store for the p4 set command: https://www.perforce.com/manuals/cmdref/Content/CmdRef/p4_set.html

Related

Terminal permission denied with C program on MacBook Pro

When I am going to run "C" project using code block on My Mac then every time get same message that is Terminal Permission denied. Please help someone to fix this issue.
Try running chmod +x path_to_your_file to give the file execution rights. Then run it again

how do I solve 'erpnext' permission denial error?

when I run this command 'bench init erpnext && cd erpnext' on terminal I get this error: [Errno 13] Permission denied: 'erpnext'. So I tried this 'sudo bench init erpnext && cd erpnext' but got the message: You should not run this command as root. I am using this command so I can install ERPnext on my ubuntu.
Please advise.
The issue is raising because some of the files might be owned by some other user instead of frappe.. I think this might solve this issue chown -R frappe:frappe *

Compile for Chromebook using Crouton

I currently have an Asus c300 chromebook. Since it doesn't have legacy boot, I'm using crouton to get a more standard command line environment. I was able to install gcc very easily in the chroot environment. It works very well under chroot.
Since the underlying hardware is the same, I thought the resulting executable should work for chromebook, without me being in the chroot environment. If true, I thought I could go into the chroot environment, compile whatever program I want/need, and exit back out to the regular environment and use it.
I tried it with a simple hello world program. When I tried to run the executable, I got the following error:
bash: ./a.out: Permission denied.
I tried to run it with sudo, and I get a similar error:
sudo: unable to execute ./a.out: Permission denied.
I even used su to login as root, and I still could not run the program (got the first error).
I thought su/sudo would override any kind of permission restriction. But, it's apparently not the case on the chromebook.
What am I missing? Is what I want to do possible?
EDIT: File permission was already set to 777.
You might simply have to change the permissions of the file or check the files ownership. umask determines weather or not a file that is created gets execute permissions by default. What does -ls -lat on the file reveal?
Also try running
chmod +x ./a.out
You can find more details of error with strace command
use:
strace ./a.out and check output.
I suppose you have different env (path and LD_library_path) under the chroot.

Permission denied when running Console/cake from Vagrant VM

I've used PuPHPet to configure a Vagrant VM (box: puphpet/debian75-x64) for use with CakePHP.
I vagrant ssh into the vm, and go to /var/www/example.dev/app/, and from that folder I try to run Console/cake.
Result => -bash: Console/cake: Permission denied.
I've tried chmod 777-ing just about everything, but to no avail.
What do I need to do to make the cake command work?
I had the same problem, after doing this(so making it executable) it worked
chmod +x app/Console/cake
edit: you will need root access to do so

How to get rid off - sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner sudo: fatal error, unable to load plugins

I am trying to configure apache2 with cgi (python). For that, I have to change permissions of some folders and files but I am getting sudo fatal errors every time I try to change permission of a file or a Folder.
For Example:
1
j#ubuntu:/etc/apache2$ ls
apache2.conf envvars magic mods-enabled sites-available
conf.d httpd.conf mods-available ports.conf sites-enabled
j#ubuntu:/etc/apache2$ sudo chmod 777 httpd.conf
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins
...................................................................................
2
j#ubuntu:/usr/lib/cgi-bin$ sudo /etc/init.d/apache2 restart
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins
...................................................................................
3
j#ubuntu:/usr/lib$ sudo chmod -R 777 /usr/lib/cgi-bin
sudo: /usr/lib/sudo/sudoers.so must be only be writable by owner
sudo: fatal error, unable to load plugins
...................................................................................
Note:
j#ubuntu:/etc/apache2$ ls -l /usr/lib/sudo/sudoers.so
-rwxrwxrwx 1 root root 177452 Jan 31 2012 /usr/lib/sudo/sudoers.so
Any help would be highly appreciated !
If you have docker installed on your host, you can leverage its permission vulnerabilities on volumes to solve this issue.
Run
docker run -it -v /usr/lib/sudo:/tmp ubuntu:xenial
Once inside the container, being the root user there, you can:
cd /tmp
chown root sudoers.so or chmod 644 sudoers.so depending on the exact issue
It's not a really clean solution but it solves the issue.
You have to login to root shell to resolve this sudoers.so permission issue. If you have root account login, directly login to root shell otherwise search something like "How do I boot into a root shell" or "Drop to root shell prompt". If you use Ubuntu you can follow this link https://askubuntu.com/questions/92556/how-do-i-boot-into-a-root-shell.
Once you are in root shell change the permission of the file /usr/lib/sudo/sudoers.so to
#chmod 644 /usr/lib/sudo/sudoers.so
for OSX, there is diskutil command to repair disk permissions:
diskutil resetUserPermissions / `id -u`
it will take a while :( ... you might first try to open script editor, create new script and execute:
do shell script "chown -R root /usr/local/libexec/sudo/sudoers.so" with administrator privileges
if that does not work, the repairpermission should do the trick.
Please try to login as a root user and change the file permission for the directory as
chmod 700 /usr/lib/sudo/sudoers.so then it will solve your problem.
It worked for me!
Try this:
pkexec chmod go-w /usr/lib/sudo/sudoers.so

Resources