FTP Configuration


File Transfer Protocol (FTP)


File Transfer Protocol (FTP) is a standard network protocol used to transfer files from one host to another host over the TCP based network such as internet. It enables easy file sharing over the network with security. Here i am going to install FTP in rpm based machine. For example: Redhat Enterprise Linux . You can access FTP from both the Command Line Interface mode and GUI mode.
Before installing FTP you must configure the yum on your machine, your system must be configured with ip address and it is must. Configure both server and client by the following way.

Server Configuration 
Here i am using Redhat Enterprise Linux 5 Server Operating System.
1. Open Terminal in root user mode.
2. Query the ftp package.
#rpm -qa | grep ftp 
3. If the package is installed leave it else install it by using the following command.
#yum install vsftpd
vsftp means ” Very Secure File Transfer Protocol “.
4. After the installation over, restart the services.
 # service vsftpd restart
5. Now configure the ftp file in the configuration directory.
# vi /etc/vsftpd/vsftpd.conf
” Change the ‘ anonymous_write = no ‘ to ‘ anonymous_write = yes ‘ and add this ‘write_enable = yes ‘ “. Save ( Esc + : + wq ) and quit it now.
The default username for any FTP server is ‘ anonymous ‘.
6. Now again restart the service.
# service vsftpd restart
In some cases firewall does not allow the ftp port, So change the firewall settings. To change the firewall settings
# service-config-firewall
and finally chkconfig the vsftpd ( It allows permanent FTP connection )
# chkconfig vsftpd on
Now test FTP with an another client.
7. Open Terminal ( Command Line Interface )
# ftp < client ip address >
username : anonymous 
password : < no default password, so just hit retun to continue >
Now your server ping the client ftp directory and the prompt is changed to ftp>
ftp> ls
ls – list the files in the directory.
Shows the files in the /var/ftp/pub. This is the default direcory for all rpm based distributions.
The server configuration is over.
Client Configuration
1. Open the Terminal in root user mode and ping with the server ip address, for checking the connectivity.
# ping < server ip address>
2. Change the directory
# cd /tmp
3. Now establish the FTP connection
# ftp <server ip address >
ex : ftp 192.10.25.36
( Same user name and password )
4. To download a file from the server – get command is used
#ftp> get helpfile
It downloads a file from server’s /var/ftp/pub to client’s /tmp
5. To upload a file to server – put command is used
#ftp> put help
It upload a file from client’s /tmp to  sever’s /var/ftp/pub
Some of the ftp commands are :
get – Download a single file
mget – Download multiple files
put – Upload a single file
mput – Upload multiple files




Ref : http://linuxinternetworks.com/

No comments:

Post a Comment