What is FTP
FTP is a File Transfer Protocol which helps us to upload / download files between computers over TCP based network. FTP is built on a client-server architecture and uses separate control and data connections between client and server. The main FTP servers available are :- vsftpd, proftpd, ftpd, wu-ftpd, wzdftpd and pure-ftpd
We can access the FTP server by two ways :-
- anonymous
- authenticated
In anonymous mode, remote clients can access the FTP server by using the default user account called “anonymous” or “ftp” and sending an email address as the password. But in the authenticated mode a user must have an account and a password. User access to the FTP server directories and files is dependent on the permissions defined for the account used at login. As a general rule, the FTP daemon will hide the root directory of the FTP server and change it to the FTP Home directory. This hides the rest of the file system from remote sessions.
Here am explaining installation and configuration of VSFTPD.
VSFTPD is the Very Secure File Transfer Protocol and have very strongest protection against possible FTP vulnerabilities.
1. Install VSFTPD . To install VSFTPD, execute the following commands on a Terminal
$ sudo su –
Password:
# apt-get install vsftpd
2. Configure VSFTPD
The default configuration file for VSFTPD is /etc/vsftpd.conf . Open the configuration file using any file editor such as vim
# sudo vim /etc/vsftpd.conf
uncomment following lines on configuration file
local_enable=YES
write_enable=YES
chroot_local_user=YES
local_enable –> this directive will allow the users to login via ftp
write_enable –> this directive will allow the users to upload files
chroot_local_user –> if you enable this , the user can access only their home directories. and will be denied access to any other part of server
Note : If you don’t want to distribute information widely , disable anonymous login. To do this change the directive anonymous_enable from anonymous_enable=YES to anonymous_enable=NO
save and close the file
3. Restart VSFTPD
# /etc/init.d/vsftpd restart
4. access FTP server
#ftp 192.168.1.31
Connected to 192.168.1.31.
220 (vsFTPd 2.3.5)
Name (192.168.1.31:root): test331 Please specify the password.
Password:
230 Login successful.
Remote system type is UNIX.
Using binary mode to transfer files.ftp> ls
-rw-r–r– 1 0 0 1447 Apr 24 12:41 1
-rw-rw-r– 1 1000 1000 131139 May 22 12:39 2013-05-22-123948_1440x900_scrot.png
-rw-rw-r– 1 1000 1000 221865 May 25 08:04 2013-05-25-080428_1440x900_scrot.png
-rw-rw-r– 1 1000 1000 108048 Jun 25 17:08 2013-06-25-170844_1440x900_scrot.pngftp> quit
221 Goodbye.
Done !!!!