Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have set up a FTP-server (vsftpd) for only one client user (ftuser). This user should have access to the folder /srv/webroot/user. The folder /srv and all subfolders are owned by me. I am not in the same group like the ftpuser is. Now I have tried to implement the user's permission in the following way:

chmod 770 -R /srv
chmod 777 -R /srv/webroot/user

But when the user tries to login via ftp the FTP-server sais:

500 OOPS: cannot change directory: /srv/webroot/user

Just as a try I gave the user rights on the whole folder strcuture by

chmod 777 -R /srv

Now he not only can login but also has access to the root folder (/) and all other subfolders (i.e. /etc, /home, ...).

How must I set the rights so that my user is able to login and gets only access to /srv/webroot/user?

share|improve this question
add comment

2 Answers

up vote 0 down vote accepted

If you want user to see only it's own files then you have to set "chroot"-related options in vsftpd.conf. Limiting access of ftp users with "chmod" and "chown" is a bad way. User must be able to write in its ftp-root dir to login.

share|improve this answer
add comment

In order to allow a user to change to a specific directory cd, the user should have the x permission (bit 1 in numeric). If you don't want to allow this permission to everyone, you need to allow it for group g+x or user u+x. Of course, you need to set the correct ownership also.

share|improve this answer
    
I thought, that I did exactly what you describe with the commands mentioned above. Didn't I? –  heinob Jun 15 '12 at 7:45
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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