Install vsftpd and create new Ftp user with specific directory in ubuntu

  1. sudo apt-get update
  2. sudo apt-get install vsftpd
  3. sudo vim /etc/vsftpd.confuncomment write_enable=YES
    uncomment chroot_local_user=YES

    Add at last in file
    user_sub_token=$USER

    allow_writeable_chroot=YES

  4. sudo mkdir directory-path
  5. sudo adduser –home=directory-path username
  6. sudo chmod -R 0777 directory-path
  7. sudo chown nobody:nogroup directory-path
  8. sudo chown username:username directory-path
  9. sudo chmod a-w directory-path
  10. sudo service vsftpd restart

Leave a Reply

Your email address will not be published. Required fields are marked *