UBUNTU: ftp-server cannot change directory when user logs in

7,312

Solution 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.

Solution 2

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:
7,312

Related videos on Youtube

heinob
Author by

heinob

We are running the first and only web-based physician's information system that is, due to client-side data encryption and many other state-of-the-art technologies, applicable with the german data security laws.

Updated on September 18, 2022

Comments

  • heinob
    heinob over 1 year

    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?

  • heinob
    heinob almost 12 years
    I thought, that I did exactly what you describe with the commands mentioned above. Didn't I?