2013-11-13

installing FTP server in linux (for centOS,Redhat,Fedora Linux)


Pranaam to all Bhai ji _/\_
today we are going to discuss about FTP server i.e file transfer protocol, which is used for file transfer from one one machine to another machine.
FTP runs on port number 21 . It use port number 21 for communication between client and server machine where as port 20 is used for data transfer (file transfer).
we will learn how to install VSFTPD
so lets start :)

installation of FTP Server(vsftpd):-
we can install ftp server using yum utility . Package name for ftp server is vsftpd. there is another ftp servers are also available like pure-ftpd but right now we will go for vsftpd :)
command for installing vsftpd using yum is(on server machine)

yum install vsftpd



ok , once you have installed FTP server package on server side machine , install ftp client package on machine from where we want to access machine via FTP.
client FTP package is ftp and we can install it using yum utility
command is (for client machine)

yum install ftp


now our client machine is ready too. but we have to configure ftp server on server side machine so that it allow us to use FTP service .
configuration file for vsftp server is in /etc/vsftpd  directory


ftpusers and user_list files are also important files for blocking/allowing users for ftp service usage .
we will discuss about them later , now we will configure ftp server by editing /etc/vsftpd/vsftd.conf file
open it using vi editor or nano (install using command yum install nano)
after making change , you will have to restart ftp service using command (service vsftpd restart)


here is screenshot of vsftpd.conf file


this configuration file has explanation for each configuration
for example , if you want to allow anonymous user(user whose account is not on machine aka unknown user)
or not , anonymous_enable=yes is the configuration for that and meaning of this option is written on just above of it (have a look on above screenshot)
if you dont want to disable anonymous user login , just change anonymous_enable=YES to anonymous_enable=NO
the main thing that we must do , is to chroot the ftp service to avoid directory traversal attack via browser


save file and exit (press esc and type :wq!  if you are suing vi editor)
you can also specify whether user is allowed upload files or not and many more options :) just go through the config file and configure it according to your need
once you have configured ftp server on server machine , restart ftp server
command is
service vsftpd restart

your ftp server is now available for users
login to FTP using command
ftp  server_ip

root user is still blocked for using FTP server
because it is mention in "not allowed" list in files ftpusers and user_list (both files are in /etc/vsftpd directory)
remove the name root from both of the files
restart ftp server and root user will be allowed to login via FTP
if you want to block a user for FTP server use , just put the username in these 2 files and user wont be able to login via FTP :P

commands for start/stop/restart vsftpd server:-
starting command
service vsftpd start

stopping command
service vsftpd stop

restart command
service vsftpd restart

this was short tutorial on ftp server installation and configuration  :)

Thank you
Greetz to:-
Zero cool , Team INDISHELL , Mannu , viki ,Hardeep bhai and AR AR bhai ji <3

Share this post

0 comments

:) :-) :)) =)) :( :-( :(( :d :-d @-) :p :o :>) (o) [-( :-? (p) :-s (m) 8-) :-t :-b b-( :-# =p~ :-$ (b) (f) x-) (k) (h) (c) cheer

© 2009 Start With Linux | Mannu Linux
Designed by cyb3r.gladiat0r
Posts RSSComments RSS
Back to top