Tuesday, March 31, 2015

ftp server configuration in linux step by step.

File Transfer Protocol

File Transfer Protocol is one of the most common services to transferring files between computers in Internet.

FTP fallow standard client & server architecture.

Main usage of FTP for downloads and uploads large files in public network (Internet).

It has inbuilt security, which makes encrypt the data transition between client and Server.  As a result it is passing sensitive information in secure manner over internet. 

FTP works on two port numbers: 

Data transfer - 20
Data control  - 21

Packages :   vsftpd

configuration file : /etc/vsftpd/vsftpd.conf

Services : vsftpd

Port number   : data transfer  à 20 

data control  à 21

Daemon : vsftpd


Configuration of FTP Server 


Step 1) CHECK & INSTALL PACKAGES 

[root@mail ~]# rpm -qa | grep vsftpd
[root@mail ~]# yum remove vsftpd* -y
[root@mail ~]# rm -r /etc/vsftpd* 
[root@mail ~]# yum install  vsftpd* -y 
Step 2) Create the resources on ftp server (file/folders & users) 
[root@mail ~]# useradd  tom 
[root@mail ~]# useradd  joy 
[root@mail ~]# passwd tom 
[root@mail ~]# passwd joy 
Create  or Copy some files inside /var/ftp/pub 
[root@mail ~]# cd /var/ftp/pub 
[root@mail pub]# touch fa.txt fb.txt music.mp3 [root@mail pub]# ls 
Create a  Upload  folder for anonymous users 
[root@mail pub]# mkdir /var/ftp/zoomupload 
[root@mail pub]# chmod 777 /var/ftp/zoomupload 
NOTE : Create a .message file in a folder to display the message on entering the zoomupload folder. 
[root@mail zoomupload]# cat > /var/ftp/zoomupload/.message This is an Upload Directory For Anonymous 
[root@mail zoomupload]# 
Step 3) Edit  the Main Configuration File 
[root@mail ~]# vi /etc/vsftpd/vsftpd.conf 

12 anonymous_enable=YES
15 local_enable=YES
27 anon_upload_enable=YES
35 dirmessage_enable=YES
83 ftpd_banner=Welcome to Zoom Linux.
:wq! 

Step 4 ) 
To block the ftp server users (for eg:-- joy) write the user name in /etc/vsftpd/ftpusers 
[root@mail ~]# vi /etc/vsftpd/ftpusers 
joy 
:wq! 

Step 5) Start the service 
[root@mail ~]# service vsftpd restart 
Client Side Configuration 


ftp Clients 

1)ftp 
2)gftp 
3)browser 
[root@client ~]# ftp 192.168.0.253 
Name (192.168.0.253:root): ftp 
331 Please specify the password. Password: 
230 Login successful. 

ftp> ls 
drwxr-xr-x 3 0 0 4096 Jul 11 20:44 pub
drwxrwxrwx 2 0 0 4096 Jul 11 21:05 upload

To download a single/multiple file use get/mget command
ftp> cd pub
ftp> ls
-rw-r--r-- 1 0 0 0 Jul 11 20:42 fa.txt
-rw-r--r-- 1 0 0 0 Jul 11 20:42 fb.txt
-rw-r--r-- 1 0 0 0 Jul 11 20:42 music.mp3
ftp> get <download file name> 
TO  upload a single/multiple file use put/mput command 
ftp> pwd 
ftp> cd .. 
ftp> upload 
ftp> pwd 
ftp> mput <upload file name>
ftp> ls
ftp> bye







No comments:

Post a Comment