I need to give access to my server to a new user. This user will access one directory used for web server, in order to modify some files there. Now, I have created the user on the server, but when I try to log in with his username, I notice that I can see and download not only this users directory (which is a folder on the web-part of the files), but all files on all the other folders too.

Don't know if this is a permission issue on the oter files (wich the user should not have access to), or on this particular user. When creating the user, I made his homedirectory to be /var/www/xxxxx where xxxxx is the actual folder he should have access to.

To be a little clearer about the other folders he can see, they are located at /var/www/yyyy All files in yyyy is visible for him and should be hidden. Any thoughts on this?

  • What are the access permission flags of those other folder? – David Foerster Nov 12 '14 at 16:09

Is the user connecting via ssh ? If so, there is a ChrootDirectory option to jail a user to a specified directory, meaning he can not navigate higher up the directory tree. Take a look here for a working example


  • Hi, and thanks for showing me this link. It's not clear for me where to put the match rule described. Tried to place it in the ssh_configfile, but that had no effect. Any hint on this too? – Roffee Nov 12 '14 at 12:25
  • Did you connect using the command sftp user@host ? The config goes in the sshd_config file. – hatterman Nov 13 '14 at 8:12

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.