Saturday, January 25, 2014

FTP SERVER configuration

####### VSFTPD  ################

SERVER :

1. yum install vsftpd -y
2. service vsftpd restart
3. setsebool -P ftp_home_dir on  ->Do this to allow user to connect


CLIENTS :

ANONYMOUS LOGIN (connecting as anonymous or ftp user and blank passwor)

ftp    <ftpserver>
name   ftp
pass  ...........        (Blank Password)

ftp>  pwd                  ->you connect to pub dir
ftp>  ls                   ->shows  remotes file  list
ftp>  !ls                  ->shows  local file  list
ftp>  get <file>           ->Copy/download files
ftp>  put <file>           ->Cannot UPLOAD files
ftp>  cd /home             ->NOT allowed to change dir
ftp>  bye                  ->Log out from ftp prompt.

NON-ANONYMOUS LOGIN (connect as normal user of remote machine)

ftp    <ftpserver>
name   u1
pass   1                

ftp>  pwd                  ->you connect to home dir of u1
ftp>  ls                   ->shows  remotes file  list
ftp>  !ls                  ->shows  local file  list
ftp>  get <file>           ->Copy/download files
ftp>  put <file>           ->Copy/Upload files
ftp>  cd /home             ->Allowed to change dir
ftp>  bye                  ->Log out from ftp prompt.



####  OPTIONS FOR /ETC/VSFTPD/VSFTPD.CONF####################

1. anonymous_enable=YES   ->Allow anonymous login
   anonymous_enable=NO    ->Stop anonymous login

2. local_enable=YES      ->Allow normal user to login
   local_enable=NO       ->Stop normal user to login

3. write_enable=YES    ->Allow normal user to create files by default
   write_enable=NO    ->Stop normal user to create files

4.  To allow Anonymous user to UPLOAD file.
a>  #anon_upload_enable=YES    ->uncomment this line +
b>  chmod a+w /var/ftp/pub     ->/var/ftp/pub dir should be writable
c>  write_enable=YES           ->write enable should b yes

5. If  Anonymous user uploads file,owner of file is ftp by default,
   but if you want u1 to be owner of file change here.
  #chown_uploads=YES
  #chown_username=u1  ->uncomment this 2 lines + user=u1


6.no_anon_password=YES  ->Wont prompt the password for anonymous user
  no_anon_password=NO   ->Prompt the password for anonymous user

 

###### To stop many users from using ftp connection  ############

1. Add the users whom you want to stop using ftp to this file +
2. And add this to /etc/vsftpd/vsftpd.conf userlist_deny=YES
3. service vsftpd restart


########### FTP USERS FILE  ################

If you want to stop one or two users from using ftp
enter there names in this file. That stops that user
from connecting throu ftp.


No comments:

Post a Comment