How to install FTP Server on Ubuntu??
In this article, I will show you step by step how to install, configure, and secure FTP server. Step by step commands are given below:
RECOMMENDED: How to install FTP server on CentOS 7
STEP 1: Install FTP Package
# sudo apt-get install vsftpd
By default Ubuntu firewall i.e. UFW is inactive. If it is activated then allow the FTP traffic through it.
# sudo ufw allow 20/tcp
# sudo ufw allow 21/tcp
# sudo ufw status
Backup the original configuration file of FTP server to restore in stuck situation.
cp /etc/vsftpd.conf /etc/vsftpd.orig.conf
Step 4 :
Disable the anonymous login for the security reasons. And allow the local users to log in to their home directory.
Next step is to start the vsftpd service.
# service vsftpd start
# service vsftpd status
Now, Jail the FTP user into the home directory. For this uncomment the following line under /etc/vsftpd.conf. Also, add the line allow_writeable_chroot=YES, allow the Jailed user to write into their directory.
chroot_local_user=YES [uncomment this line]
allow_writeable_chroot=YES [Add this line]
If want to create FTP user with custom home directory, run the following commands.
# sudo useradd -m -d /var/ftp/pub -s /usr/sbin/nologin arun
# sudo passwd arun
Now, when FTP user arun will login to FTP he would be landed in /var/ftp/pub directory.
Final step is to browse the ftp server. Open the browser and just type ftp://server-ip.
From Command Line:
# ftp 10.0.2.15