FTP is used to transfer files from one host to another over TCP network. This article explains how to setup FTP server on ubuntu 14.04. There are 3 popular FTP server packages available PureFTPd, VsFTPD and ProFTPd. Here i’ve used VsFTPD which is most secure. I’ll be logged in as root.
Setup vsFTPd server on Ubuntu 14.04
Step 1 – Update repositories.
Step 2 – Install VsFTPD
Step 3 – Backup config file
Step 4 – Open config file with follow command.
Step 5 – Configration of vsFTPd file – Open /etc/vsftpd.conf file and search with Ctrl+W and make changes as it is shown below. Remove commends if they exist or add missing line.
local_enable=YES
write_enable=YES
allow_writeable_chroot=YES
chroot_local_user=YES
file_open_mode=0777
local_umask=022
Step 6 – Configration of vsFTPd file – Allow access only for certain users.
userlist_enable=YES
userlist_file=/etc/vsftpd.allowed_users
Step 7 – Create /etc/vsftpd.allowed_users
Step 8 – Include users who should have access in /etc/vsftpd.allowed_users
yourSECONDuser
yourTHIRDuser
Step 9 – If you want, you can make Advanced Configuration
force_dot_files=YES
#Hide the info about the owner (user and group) of the files.
hide_ids=YES
#Maximum number of clients:
max_clients=20
#Connection limit for each IP:
max_per_ip=2
#Chnage listen port from 21 to other
listen_port=999
Step 10 – Add ftp user and change home directory for this user. This is very important because you will restrict the user to access to one directory. You can allow access to /var/www/ and the user will have access to all folders on your sites or choose to access to only one site. For example if you want to create ftp user and to allow him to access to only one site, write the following commands. And don’t forget to add new user in /etc/vsftpd.allowed_users
root@mail:/# usermod –home /var/www/YOURFOLDERSITE ftp
or open this file /etc/passwd and search user which you want to change home directory. Change /home/ftpuser with /vat/www.
root@mail:/# ftpuser:x:1001:1001:FTP USER,,,:/var/www:/bin/bash
Step 11 – Restart vsFTPd – You must restart vsFTPd service for the changes to take effect. Now when user connect via ftp with filezilla he will see only one folder from your sites.
Step 12 – Configuration of permissions – If you want everybody to have a permission to write in this folder, you have to set full permission 777. If you want only the ftp group to have permission to write and everyone else to have permission only to read, you have to set a permission 775.
root@mail:/# chown ftp:ftp -R /var/www/YOURFOLDERSITE
6 Theme – How to install and configure SSH on Ubuntu (Server) 14.04 LTS Step-by-Step