Monday, December 3, 2012

FTP server on Redhat



FTP server on Redhat

FTP server used for downloading and uploading the files over the network from FTP server to client. FTP server is very popular server for download and uploads the files.
Package name :                                vsftpd                   (very secure ftp demon)
Configuration file :                           /etc/vsftpd/vsftpd.conf
Port no. :                                             20 (data), 21 (connection)
Service or demon :                          vsftpd
Share database path or default path : /var/ftp/

  FTP user authentication:
FTP provide two types of authentication 
 Guest account (anonymous user) username : ftp or anonymous
Lacal user authentication
Anonymous user can only download files by default.
Local user can upload and download files by default.

Configuration :
#yum install vsftpd*
#service vsftpd restart
#chkconfig vsftpd on


Client end ftp server access
#ftp  <ftp server ip>
Username : ftp or anonymous
Password : blank
#ftp> ls
#ftp>get  <file>   for downloading the single file
#ftp>mget  <file>  <file>  <file>  for multiple downloading

#ftp>put  <file>   for downloading the single file
#ftp>mput  <file>  <file>  <file>  for multiple downloading
#ftp>bye                for exit

how to upload files via anonymous user :  we know that by default anonymous user does not upload files, it can only download.
For uploading following task perform
#vim /etc/vsftpd/vsftpd.conf
Go to line no. 27
Remove hash “#”             uncomment

Save and exit

When u want to upload file, dir must be writable by ftp user.
#setfacl –m u:ftp:rwx /var/ftp/pub
Or
#mkdir /var/ftp/upload
#setfacl –m u:ftp:rwx /var/ftp/upload
#service vsftpd restart
THEN get and put

Disable anonymous user
#vim /etc/vsftpd/vsftpd.conf
Line no.12  anonymous_enable=YES   ise NO karenge
Save and exit
#service vsftpd restart

Local user authentication
Local user can upload and download, coz user have full permission for his home directory.
On server
#adduser irfan
#passwd irfan     password the password
#ftp <ftp server ip>
Username : irfan
Password : irfan
We can upload and download files. all files user saves in users home directory.

Disable local user
#vim /etc/vsftpd/vsftpd.conf
Line no. 15   local_enable=YES   yaha NO karenge.
#service vsftpd restart

No comments:

Post a Comment