ftp(File Transfer Protocol) server installation and configuration in linux

Before install and configuration of ftp server in linux.The ftp server called in linux is vsftpd(Very Secure FTP Daemon). Default ports for FTP are 20 and 21.
Port 20 is used for Data Channel or Data Communication(Upload or Download Data).
Port 21 is used for Control Channel or  establish connection

Install vsftpd in linux:  yum install vsftpd*
If we have download rpm of  vsftpd then got the directory and ran below command
rpm -ivh vsftpd*
Once vsftpd is installed, it will create a default directory in /var/ftp/pub . By default vsftp allow only download.

To enable upload we need create a folder in /var/ftp/pub and  allow download in vsftpd configuration file.
vsftpd.conf is a configuration of vsftpd located in /etc/vsftpd/.
1.Create download folder in /var/ftp/
mkdir -p /var/ftp/download
chmod 777 /var/ftp/downlad ###give full permission to download folder
2.Open vsftpd.conf and allow download
vi /etc/vsftpd/vsftpd.conf
Uncomment or remove "#" form line number 27th   ###This will enable uploading
Uncomment or remove "#" form line number 83rd  ###This will provide message to user
Uncomment or remove "#" form line number 27th  ###This will enable log file option. By default vsftpd doesn't creat any log file. Once we enable log then a log file will be created as vsftpd.log in /var/log/vsftpd.log
Need to restart vsftpd service to effect the chanes.
service vsftpd restart ### The settings temporary
chkconfig vsftpd on  ### Settings saved permanently

 Commands to  connect ftp server and upload or download data.
ftp   
ls                  ###List
get               ### Download data
mget            ### Download multiple
mget *         ###Download complete data
put              ### Upload Data
mput           ###Upload multiple files or folders
mput *        ###Upload complete data
!                 ### Exit form ftp session temporarily
exit            ### To back to ftp session
lcd /opt      ### Change Directory
bye           ### Quit ftp session
prompt     ### To enable or disable passive mode



No comments:

Post a Comment