Tuesday, October 18, 2011

How to configure linux ftp server step by step guide Example and Implementation

How to configure linux ftp server step by step guide Example and Implementation


Configuring the ftp Server

The vsftpd RPM package is required to configure a Red Hat Enterprise Linux system as an ftp server. If it is not already installed, install it with rpm commands as described in our pervious article. After it is installed, start the service as root with the command service vsftpd start . The system is now an ftp server and can accept connections. To configure the server to automatically start the service at boot time, execute the command chkconfig vsftpd on as root. To stop the server, execute the command service vsftpd stop. To verify that the server is running, use the command service vsftpd status.

Configure vsftpd server


per quest of vsftpd server

  • A linux server with ip address 192.168.0.254 and hostname Server
  • A linux client with ip address 192.168.0.1 and hostname Client1
  • A window client with ip address 192.168.0.2 and hostname Client2
  • Updated /etc/hosts file on both linux system
  • Running portmap and xinetd services
  • Firewall should be off on server

necessary configuration for vsftpd server

We suggest you to review that article before start configuration of ssh server. Once you have completed the necessary steps follow this guide.

Three rpm are required to configure ssh server. vsftpd, portmap, xinetd check them if not found then install
rpm

Now check vsftpd, portmap, xinetd service in system service it should be on

 #setup Select System service from list [*]portmap [*]xinetd [*]vsftpd 

Now restart xinetd and portmap and vsftpd service
service restart
service vsftpd restart
To keep on these services after reboot on then via chkconfig command
chkconfig
After reboot verify their status. It must be in running condition
service status

Create a normal user named vinita
useradd

Login for this user on other terminal and create a test file
create file

On Linux client

ping from ftp server and run ftp command and give username and password
user login ftp server
after login you can download files from the specified directories

Most commonly commands used on ftp prompt are

 put     To upload files on server get     To download files from server mput    To upload all files mget    To download all files ?       To see all available command on ftp prompts cd      To change remote directory lcd     To change local directory 

help commands on ftp server


On window clients

Now go on window clients and create a file. copy con command is used to create files on window. To save use CTRL+Z
copy con

Now ping from ftp server and invoke ftp session from server, login from user account and download as well as uploads files
user login on window system

Enable root account for ftp session and set permission on user

By default on vsftpd server root account is disable. You cannot login from root account.
deny root for ftp sessions

Now we will enable root account for ftp session and same time we will disable our normal user vinita to use ftp sessions.

open file /etc/vsftpd/ftpusers . Users whose name are set in this file will not allowed to login from ftp.
vi ftpuser
ftp user

By default this file have an entry for root that why root are not allowed to use ftp. remove root from list and add user vinita
ftp user

Now remove entry form /etc/vsftpd/user_list files. Users whose names are set in this file are also not allowed to login from ftp even they are not prompt for password.

userlist
By default this file have an entry for root that way root is denied form login even not asked for password remove root from list and add user vinita
userlist

After saving change in these files restart the vsftpd service
service vsftpd restart

Now go on client system and login from root this time root will login
root login

Now try to login form user vinita she should not prompt form password also
deny vinita

How to set login banner for ftp server

To set login banner open /etc/vsftpd/vsftpd.conf file and search for this tag
banner
Uncomment this tag and set your banner and save file , and restart the vsftpd service
banner

Go on client system and check banner it will appear before user login




No comments: