Install and configure FTP Server(vsftpd) in Linux

Steps to install and configure FTP(vsFTPd) in linux (Fedora, CentOS, RedHat, etc)

follow all steps except marked as “optional”
Step1: Install vsftpd packages

[root@server ~#]yum install vsftpd


Step2: Edit vsftpd configuration file /etc/vsftpd/vsftpd.conf
[root@server ~#]vi /etc/vsftpd/vsftpd.conf
(edit the following lines/ remove the “#”  infront of all the below lines )
# in 12th line line
anonymous_enable=NO


# in 51st line line( for upload/download logging)(optional)
xferlog_file=/var/log/vsftpd.log


# in 58th  line( set when an idle session time-outs, in seconds) (optional)
idle_session_timeout=1000




#in 80th & 81st line
ascii_upload_enable=YES
ascii_download_enable=YES


#in 84th line(set your banner) (optional)
ftpd_banner=Welcome to servercomputing ftp service.


#in 95th and 96th line
chroot_local_user=YES
chroot_list_enable=YES


#in 98th line
chroot_list_file=/etc/vsftpd/chroot_list


# in 104th line
ls_recurse_enable=YES


#Add the following below line to the bottom
#to use local time
use_localtime=YES


#Add the following below line to limit transfer speed to 1MB/sec(optional)
local_max_rate=1000000


max_clients=5                                           #add to allow maximum 5 connections at a time(optional)
listen_port=200                                         # This is the method to change ftp port number(optional)
#save the vsftpd.conf file


Step:3 create users for ftp access(eg: james)
[root@server ~#]useradd james
OR
use the below command to create the user in nologin shell(recommended)
[root@server ~#]useradd -s /sbin/nologin james


Step4: (create a new chroot_list file and add james) add user james to file to allow ftp access
[root@server ~#]vi /etc/vsftpd/chroot_list
#add the user ‘james’ to the file
james
#save the chroot_list file. (u can add more users to use ftp by adding usernames to “chroot_list” one by one downwards)


Step5:start ftp daemon
[root@server ~#]service vsftpd start


Step6: add ftp to startup
[root@server ~#]chkconfig vsftpd on


[Important: By default ftp service will listen on port 21/tcp, so you must open port 21/tcp in firewall or disable firewall]

0 comments:

Related Posts Plugin for WordPress, Blogger...

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Bluehost Coupons