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?


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.

| improve this answer | |

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.

| 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

heinob - there is a section in the /etc/vsftpd.conf as follows

# You may specify an explicit list of local users to chroot() to their home directory. If chroot_local_user is YES, then this list becomes a list of users to NOT chroot().(Warning! chroot'ing can be very dangerous. If using chroot, make sure that the user does not have write access to the top level directory within the chroot)
# (default follows)

Are you sure the chroot_local_user=YES is not uncommented?

| improve this answer | |

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.