Simply type the following command as a superuser (root) to install vsftp server:
# sudo apt-get install vsftpd

Once vsftpd is installed, you can modify the configuration.

The default configuration file is /etc/vsftpd.conf file.

# sudo vi /etc/vsftpd.conf

You need to change the anonymous_enable from YES to NO:

anonymous_enable=NO

To enable writing, directory listing and the directories to created with permission readwrite uncomment below sections in

local_enable=YES
write_enable=YES
local_umask=022

To enable users to be jailed to only specific directory enable below constants in vsftpd.conf

chroot_list_enable=YES
# (default follows)
chroot_list_file=/etc/vsftpd/chroot_list

Then open the file /etc/vsftpd/chroot_list (if not present create it) and add the username to be jailed , by default the user in this list will be jailed to their home directory ex:- /home/jsmith

Type the following command to start the vsftp server at bootup:

# chkconfig vsftpd on

Type the following command to start the vsftp server:
# service vsftpd start

Type the following command to stop the vsftp server:
#sudo  service vsftpd stop

Type the following command to restart the vsftp server:
# sudo service vsftpd restart

If you use iptables:

Open /etc/sysconfig/iptables file, enter:
# sudo vi /etc/sysconfig/iptables

Append following line to open ftp port 21 before REJECT line:
-A RH-Firewall-1-INPUT -m state –state NEW -m tcp -p tcp –dport 21 -j ACCEPT

Save and close the file. Restart the firewall:
# sudo service iptables restart

Leave a Reply

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