3

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?

3 Answers 3

1

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.

1

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.

1
  • I thought, that I did exactly what you describe with the commands mentioned above. Didn't I?
    – heinob
    Jun 15, 2012 at 7:45
0

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)
#chroot_local_user=YES
#chroot_list_enable=YES
# (default follows)
#chroot_list_file=/etc/vsftpd.chroot_list

Are you sure the chroot_local_user=YES is not uncommented?

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .