vsftpd default permissions for website directory and ftp

5,790

My solution.

with chroot_local_user set to YES, the root should be the owner of the home directory, after that you can create other directory and assign permission to the FTP USER so he can do everything he want.

Root user access/permission to /srv/www/domain

FTP user access/permission to /srv/www/domain/public_html

Share:
5,790

Related videos on Youtube

Francis Chartrand
Author by

Francis Chartrand

Updated on September 18, 2022

Comments

  • Francis Chartrand
    Francis Chartrand over 1 year

    I'm trying to setup vsftpd and my users correctly. I can connect to the ftp with my user but I can't create any directory or file. My websites folder will be there: /srv/www/domain

    vsftpd.conf

    anonymous_enable=NO
    local_enable=YES
    write_enable=YES
    local_umask=022
    chroot_local_user=YES
    

    Directory permissions

    drwxrwxr-x  4 root www-data 4096 Oct  5 20:58 www
    
    drwxrwxr-x 2 user_ftp www-data 4096 Oct  5 22:19 domain
    

    User group

    user_ftp => www-data


    It's strange because when the domain folder have:

    • 755 permission: I can't connect to my FTP account (500 OOPS: vsftpd: refusing to run with writable root inside chroot()) but I can add files & folders (if i change the permission when i'm logged)
    • 575 permission: I can connect, but can't edit/delete/add files & folders

    What I'm doing wrong :)?