Monday 16 May 2011

FTP Server


File Transfer Protocol (FTP)
           
                 FTP is a program that allows transferring the file between computers present in the network. It works on port number 20 and 21.
Configuration file:
1.                   /etc/vsftpd/vsftpd.conf                               (Main configuration file)
2.                   /etc/vsftpd/ftpusers                      (Deny user list file)
3.                   /etc/vsftpd/user_list                     (Allow user list file)

                Configure FTP Server:
# rpm –ivh --force vsftpd + <Tab>                    (For install FTP service forcefully)
# chkconfig --list vsftpd                                        (For check vsftpd configuration on run level)
# chkconfig vsftpd on                                            (For on vsftpd configuration on all run level)
# service vsftpd  restart                                        (For restart the vsftpd service)
# ps –ef | grep vsftpd                                            (For checking demon process run or not)

Note: Disable Firewall and SELinux in Firewall Setting.

Login on FTP Server: Open terminal in UNIX OS or open MS DOS in Windows OS and follow bellow instructions.
1. In UNIX OS:-
# ftp 192.168.1.3                                               (IP of FTP Server)
Name (192.168.1.3:root):                             (Enter user name)
Password:                                                           (Enter user password)
230 Login successful.
ftp>

Login as anonymous user:
# lftp 192.168.1.3                                             (IP of FTP Server)
lftp 192.168.1.3:~>                                          (There is not ask any password)

2. In Windows OS:-
C:\> ftp 192.168.1.3                                         (IP of FTP Server)
User (192.168.1.3:(none)):                           (Enter user name)
password:                                                           (Enter user password)
230 Login successful.
ftp>

Change FTP port number: To change FTP port number edit its main configuration file "vsftpd.conf" and find the line as "listen_port=21", Replace port number 21 with any desire available port number. If above line doesn't here, write this line in this file and save it.
# vi /etc/vsftpd/vsftpd.conf
 listen_port=210
:wq
# service vsftpd restart

            Check current FTP port number:
# netstat -lnp | grep ftp
tcp     0     0 0.0.0.0:210     0.0.0.0:*     LISTEN     1311/vsftpd

            Login on FTP server with different port number:
# ftp <ip_address> <port_number>
# ftp 192.168.1.3 210

                Allow a user to login through FTP server: Add a new line “userlist_deny=NO” in FTP main configuration file “/etc/vsftpd/vsftpd.conf” for allow all users of “user_list” file. Then add a user which you want to allow login through FTP server in “/etc/vsftpd/user_list” file.
# vim /etc/vsftpd.conf
                Go to bottom of this file and a new line.
userlist_deny=NO
:wq
# echo nilesh >> /etc/vsftpd/user_list  (Here nilesh is a user which allow to FTP Server)

                Deny a user to login through FTP server: Add the user which you want to deny login through FTP server in “/etc/vsftpd/ftpusers” file.
# echo rajesh >> /etc/vsftpd/ftpusers   (Here rajesh is a user which deny to FTP Server)

No comments:

Post a Comment

Boot to UEFI Mode or legacy BIOS mode

Boot to UEFI Mode or legacy BIOS mode Choose UEFI or legacy BIOS modes while installing Windows. After Windows is installed, if you nee...