Permission denied when running Console/cake from Vagrant VM - cakephp

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

Related

Openbravo Tomat permissions

I've got a problem with the Openbravo module management. When I want to rebuild, the Openbravo drop that alert message.:
No write permissions to Openbravo folder. Tomcat is not able to write in this folder. Please change permissions.
Can You help me? I don't know which folder that.
I'm posting this answer keeping in mind that you are working on Linux system.
This problem occurred because your project don't have openbravo permission.
In your machine there is an openbravo user, so now you need to give the folder openbravo permission to do that go to the folder where you install openbravo for example.
cd /opt/
know use ll command and change project owner by running this two command
chown -R openbravo:tomcat6 projectName
after that use this command
chmod -R 775 projectName

Vagrant: unable to change directory user:group

I have set up Vagrant (ubuntu/trusty64) on Mac and it's working perfectly except the fact I just cannot change directory permissions.
I have CakePHP project running in /var/www/[projectName] which is also the default www-directory.
Now, CakePHP cache engine needs access to /var/www/[projectname]/app/tmp/cache but the user:group is set to vagrant:vagrant. I try to change it with sudo chown -R vagrant:www-data [path] but it just doesn't change. It always stays as vagrant - vagrant when I need it to be vagrant - www-data.
Chmod works (setting for example from 775 to 777).
Any ideas why I cannot change permissions?
You can use synced folders
config.vm.synced_folder ".", "/var/www",
owner: "vagrant",
group: "www-data",
mount_options: ["dmode=775,fmode=777"]
Here there a good example

Vagrant Up by Non-Sudo Vagrant User fails

I created a new non-sudo user(user1) in vagrant(Ubuntu 12.04 OS), and added the insecure public key to the user1 authorised key file. In vagrant file, added the default user as "user1" :
config.ssh.default.username = "user1"
Now vagrant up is failing with following error message:
The following SSH command responded with a non-zero exit status.
Vagrant assumes that this means the command failed!
mkdir -p /vagrant
Stdout from the command:
Stderr from the command:
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: no tty present and no askpass program specified
Sorry, try again.
sudo: 3 incorrect password attempts
But if am setting the sudo user for default user, then vagrant up is successful.
Can anyone help me with the changes I need to do to enable vagrant up for non-sudo users.
Vagrant requires root/sudo permissions on the VM for almost all of it's operations; like configuring the networking, mounting shared folders, running provisioners, etc. So you wouldn't get very useful VM without sudo even if you managed to avoid it.
Note that you only need sudo access on the guest. Vagrant commands itself can (and should) be run as a non-root user on the host.

CakePHP chmod 775 vs 755

I've got a strange problem. After creating an application (CakePHP v2.4.9) I've deployed it to virtual server online. It wasn't working so I went through some steps:
chown -R user:group, chmod -R 775, checked for BOM, checked for mod_rewrite etc.
I've tried complete new application on server, same steps and nothing. Only after chmod -R 755, everything worked out.
Now, on a shared server, chmod -R 775 works great. What could cause this behavior? As far I can tell, 755 are less permissions than 775. Even chmod -R 777 wasn't the solution, only 755 was.
Virtual server PHP version: 5.4.27
Shared server PHP version: 4.4.9
Some servers are configured to not run files with permissions that are too open. Especially on shared hosting.

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