I'm trying to set up a 'deploy' user on my VPS (running CentOS 6 and cPanel) which needs to have access to a specific folder from another home directory: /home/nazeem/public_html/staging.

I've created the deploy user succesfully, but logically it didn't have access to the specific home folder of user nazeem. After some reading I discovered that I need to put both users in a group and give the staging folder group permissions.

I've added both users to the group deploy, as is displayed in the /etc/group file:


I also changed the ownership of the folder:

drwxrwxr-x  3 deploy deploy 4096 feb 21 20:07 staging/

However, when I cd to the folder as user deploy, I still get the following:

-bash: cd: /home/nazeem/public_html/staging: Permission denied

Does anybody have any idea how to fix this?


You should also ensure that you have the right to access (go through) the /home/nazeem/public_html and /home/nazeem folders. You can achieve this by doing a chgrp to group deploy on both folders, and setting the execution rights for the group on these folders (execution permission on a directory gives the right to go through it).

chgrp deploy /home/nazeem/public_html /home/nazeem
chmod g+x /home/nazeem/public_html /home/nazeem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.