Updated on: 22.Apr.2014
Note: you may use SFTP over SSH without using the vsftpd program.
To add ftp user, use the following command which creates a folder in ‘home’ and set the password.
sudo adduser myftpuserid
If the user directory already exist and you want to change the ownership
sudo chmod myftpuserid:myftpuserid /home/testUserDirectory
In /etc/vsftpd.conf, ensure the following settings match the following:
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=NO
chroot_list_enable=YES
Just in case all changes have done in vsftpd.conf but you are still not able to connect to the ftp service, make the following change :
pam_service_name=ftp
You must create (if not exists) the file ‘/etc/vsftpd.chroot_list’ and each line is the user ID (ie, the OS user ID). This will prevent them from accessing the parent directory and also the root.
To restart the FTP service:
sudo service vsftpd restart
Make sure that the user directory is ‘r-x’ (where ‘ftpuser’ is the user directory) and below command remove ‘w’ (write) permission:
chmod a-w /home/ftpuser
Follow the reference URL (digitalocean.com) to configure the SSL for FTP. Once this is done, you may use FTP FileZilla to connect to your server - you may choose “SFTP - SSH” option from the “protocol” drop down list. This means, the connection is secured.
Reference
https://www.digitalocean.com/community/articles/how-to-configure-vsftpd-to-use-ssl-tls-on-an-ubuntu-vps
http://askubuntu.com/questions/184917/how-to-create-a-user-for-ftp-server
https://help.ubuntu.com/community/vsftpd
No comments:
Post a Comment