Installation of ftp server
From Erlands Wiki
Now, lets install a ftp server, my choice for ftp server is vsftpd and to install it you will have to do the following.
- 1. sudo apt-get install inetutils-inetd vsftpd
- 2. sudo /etc/init.d/vsftpd stop
- 3. sudo vi /etc/vsftpd.conf
- 4. Change the following lines:
listen=NO anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 ftpd_banner=Welcome to this private FTP service, all activities will be logged. chroot_local_user=YES secure_chroot_dir=/var/tmp/vsftpd
- 5. Save and exit
- 6. sudo mkdir /var/tmp/vsftpd
- 7.
sudo update-inetd --add "ftp\tstream\ttcp\tnowait\troot\t/usr/sbin/tcpd\t/usr/sbin/vsftpd"
- 8. sudo vi /etc/pam.d/vsftpd
- 9. Add the following line at the end:
auth required pam_listfile.so item=group sense=allow file=/etc/ftpgroups onerr=succeed
- 10. Save and exit
- 11. Create a file /etc/ftpgroups that contains a single row:
users_ftp
- 12. Make sure the following line exists in /etc/hosts.deny, if not add it:
ALL: ALL
- The above will make sure only hosts listed in hosts.allow can access the FTP server
- 13. sudo vi /etc/hosts.allow
- 14. Add a line like this where 192.168.0.0 is your local network or whatever network you want to be able to access your ftp server:
vsftpd : 127.0.0.1,192.168.0.0/255.255.255.0
- 15. Save and exit
- 16. Restart the ftp with:
sudo /etc/init.d/inetutils-inetd restart
- 17. sudo groupadd users_ftp
- 18. For each user that you want shall be able to access the ftp server run the following command where xxx is the username:
sudo addgroup xxx users_ftp
You should now be able to use your newly installed FTP server
