FTP in linux(CENTOS 6.0)

File Transfer Protocol(FTP) is one of the oldest members of the TCP/IP protocol stack and is still in the common use.
As the name suggests, it is optimized for transferring files.

Types of FTP Services.

  • VSFTPD- Very Secure FTP Daemon
  • WU-FTP- Washington University's FTP
  • ProFTPD- Professional FTP Daemon.
In Linux operating system, by default there there are three services which is used to share files and directories to multiple different clients.


Service
Port no
Advantages
Disadvantages
NFS
2049
Files & directories can be shared –support clients Linux & Unix.
Unsupported for windows operating system.
FTP
20,21
Files & directories can be shared –supports all operating systems.
No Directories can be downloaded, only files are allowed to download
Samba
137,138,139
Files, directories & Hardwares (printers) can be shared – supports all operating systems.
>80%, windows operating system used as clients
 

  • FTP is used to share different types of files to many clients.
  • EG: .zip, .rpm, .doc, .html, .php, .exe, .tar, .tar.gz, .mp3, .txt
  • FTP support LAN & WAN network
  • Clients access the data with the help of CLI+GUI (uploading & downloading).
  • Supports any operating systems for clients
  • Users & passwords security.
By default there are two types of users which is used to access FTP service in client system.
  1. FTP User
  2. Local User

FTP User:

  • Created by Operating system to manage FTP  service
  • Default home directory for the FTP user is /var/ftp
  • FTP user not able to change the home directory.
  • There is no password security for FTP user.

Local User:

  • Created by admin
  • Default home directory /home
  • Local user can change the home directory
  • For local user password is compulsory.
Requirements of FTP server

  • Installation packages
    -VSFTPD*
  • Configuration file
    -/etc/vsftpd/vsftpd.conf
  • Port numbers
    -20 Data Transfer
    -21 Control connection
  • Service/Daemon
    -vsftpd
Step1: ton configure FTP server
Check system IP address
#ifconfig eth0
Assign the hostname temporarily and permanent.
#hostname ftp.group.com
# vi /etc/sysconfig/network
Edit the hostname
HOSTNAME=ftp.group.com
:wq!
Add the host entries.
#vi /etc/hosts
go to insert mode
192.168.1.253    ftp.group.com    ftp
:wq!
Then logoff & login
Now install the package.

#yum install vsftpd* -y

Create a directory with full permission for uploading
#mkdir -m 777 /var/ftp/upload

Create multiple files
#vim /etc/vsftpd/vsftpd.conf
set the line numbers.
:se nu
Go to line no: 12 & 15
12 anonymous_enable =YES
15 local_enable = YES
 Go to line no: 27
Remove the hash '#' enable the line
27 anon_upload_enable= YES
:wq!
update the service
#service vsftpd restart
To enable the service permanent
#chkconfig vsftpd on

On sys2, To download single file.
#get
to downlaod multiple files
#mget
#put --> upload single file
#mput --> upload multiple file
#prompt --> disable interactive mode.
#lcd --> To change local directory
#by --> exit/quit from ftp.

Connect to  Server
#ftp 192.168.1.253
username: ftp
passwd:
ftp>ls
ftp>cd pub
ftp>ls
ftp> get <filename>
ftp> prompt
ftp>lcd /root/Desktop <optional>
ftp>mget <filename>*
ftp>by
#ls /root/Desktop

Upload the files from client to server system.
Create multiple file in client system.
#touch <filename>{1..10}
Connect to ftp server
#ftp 192.168.1.253
():ftp
():
ftp>ls
ftp>cd upload
ftp>put <filename>
ftp>prompt
ftp>mput <filename>*
ftp>by
Verification on Server.
check the files
#ls /var/ftp /upload
to download file in GUI
#Firefox ftp://192.168.1.253 &





Comments

Popular posts from this blog

Reasoning-Number Series

Reasoning-Letter Series

Profit and Loss