Thursday 3 November 2011

Configuration of FTP Server in LINUX

Ftp server is designed for uploading and downloading the files, when ftp server users log's in, they get their home folder at client side and if public/anonymous user log's in they get data stored in /var/ftp folder

Steps to Configure FTP Server in LINUX

Step:--1.  Check and install required Packages

Check the packages are installed or not by rpm/yum command

[root@server ~]# rpm -q vsftpd

Remove the packages and old data if required

[root@server ~]# yum remove vsftpd* -y

Install the Packages

Note: Here my file is at Desktop. So i was changing the path to Desktop.

[root@server ~]# cd /root/Desktop/
[root@server Desktop]# ls

FileZilla3  tomcat  vsftpd-2.0.5-10.el5.i386.rpm

[root@server Desktop]# chmod 777 vsftpd-2.0.5-10.el5.i386.rpm

[root@server Desktop]# rpm -ivh vsftpd-2.0.5-10.el5.i386.rpm
warning: vsftpd-2.0.5-10.el5.i386.rpm: Header V3 DSA signature: NOKEY, key ID 37017186
Preparing...                ########################################### [100%]
   1:vsftpd                 ########################################### [100%]

Step:--2. Create the resources on ftp server (file/folder & Users)

   Create users and assign passwords to whom you want to allow logging through ftp
  
   [root@server ~]# useradd tom
   [root@server ~]# useradd joy
   [root@server ~]# passwd tom
   Changing password for user tom.
   New UNIX password:
   BAD PASSWORD: it is too simplistic/systematic
   Retype new UNIX password:
   passwd: all authentication tokens updated successfully.
   [root@server ~]# passwd joy
   Changing password for user joy.
   New UNIX password:
   BAD PASSWORD: it is too simplistic/systematic
   Retype new UNIX password:
   passwd: all authentication tokens updated successfully.
   [root@server ~]#

Create or Copy some files inside /var/ftp/pub folder

[root@server ~]# cd /var/ftp/pub/
[root@server pub]# touch fa.txt fb.txt music.mp3
[root@server pub]# ls
fa.txt  fb.txt  music.mp3


Create a Upload folder for anonymous users and give full permission for read/write.

For example LINUX N UNIX HELP UPLOADS

[root@server pub]# mkdir /var/ftp/linux n unix help uploads
[root@server pub]# chmod 777 /var/ftp/linux n unix help uploads
[root@server pub]#


Step:--3. Edit the Main Configuration file /etc/vsftpd/vsftpd.conf

[root@server ~]# vi /etc/vsftpd/vsftpd.conf

  12 anonymous_enable=YES
 
  15 local_enable=YES

  27 anon_upload_enable=YES

  83 ftpd_banner=Welcome to LINUX N UNIX HELP

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


# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
mail
news
uucp
operator
games
nobody
joy
~
~
~
~
~
~
~
:wq!


Step:--5. start th ftp service


[root@server ~]# vi /etc/vsftpd/ftpusers
[root@server ~]# service vsftpd restart
Shutting down vsftpd:                                      [FAILED]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@server ~]# service vsftpd restart
Shutting down vsftpd:                                      [  OK  ]
Starting vsftpd for vsftpd:                                [  OK  ]
[root@server ~]#



Note:--- Your system Firewall should be turnoff or In firewall settings ftp exception should be added.

For Checking your ftp in Client Machine, Do the following steps:

1.Open the Web Browser and give following URL

ftp://192.168.10.121/

Here replace your ftp server IP address.

To upload or Any changes use any Ftp Software like Winscp or Filzilla , etc....


0 comments:

Post a Comment

 
Design by Free WordPress Themes | Bloggerized by Lasantha - Premium Blogger Themes | Affiliate Network Reviews