Easy way to Build FTP server in Ubuntu Server 12.04




vsftp change root directory


FTP (File Transfer Protocol) is one way we communicate with remote computers. On this occasion I would share a tutorial onhow to build an FTP server ubuntu server LTS 12.04, Acctualy,there are many applications that can be used in building FTP server, but on this tutorial how to build an FTP server on ubuntu server LTS 12.04 I will use an application called vsftpd (Very Secure FTP Daemon).



sftpd uses the GPL license and can be used on all UNIX family, including in Linux. Other benefits of vstpd more “secure” (compared with) the other FTP server application, faster, and more stable.
Let’s Start It, Now login to server with ssh. then install vsftpd with command below
sudo apt-get install vsftpd
After vsftpd installation is complete. actually, you no longer need to configure the vsftpd, because the default configuration is very secure and can be directly used. But if you want to edit the configuration you can edit the file /etc/vsftpd.conf with command below:
nano /etc/vsftpd.conf
If you want your users can upload files on your FTP server, find and edit the following line:
# Uncomment this to enable any form of FTP write command.
write_enable=YES
If you do not want the anonymous FTP user free access to your server, please edit the following line:
# Allow anonymous FTP? (Disabled by default)
anonymous_enable=NO
save (CTRL+O) your configuration and Exit (Ctrl+X), then restart vsftpd service with commads below:
sudo service vsftpd restart
You can change the root directory in vsftp as you wish..
If you enable chroot_local_user=YES, it will restrict local users to their home directories.
Some time you may want to change your root form home directory to other directory.
To change the home directory from user home directory to other directory add following lines in your  vsftpd.conf (/etc/vsftpd.conf).
anonymous_enable=YES
anonymous_root=/home/user/dir (hear you can set the directory as you wish)
Following is my vsftpd.conf
listen=YES
anonymous_enable=YES
local_enable=NO
write_enable=YES
dirmessage_enable=YES
use_localtime=YES
xferlog_enable=YES
connect_from_port_20=YES
secure_chroot_dir=/var/run/vsftpd/empty
pam_service_name=vsftpd

rsa_cert_file=/etc/ssl/private/vsftpd.pem
anon_root=/home/abc/mydir
-Sany

Comments

Popular posts from this blog

PHPMixBill V5 mikrotik Billing Solutions

How to install Asterisk and A2billing on Ubuntu Server 12.04LTS

odbcinst: SQLGetPrivateProfileString failed with