Showing posts with label ftp. Show all posts
Showing posts with label ftp. Show all posts

Wednesday, 4 September 2013

Configuring FTP (Download/Upload)


  1. Anonymous Download
    1. #yum install vsftpd
    2. #service vsftpd restart
    3. #chkconfig vsftpd on
  2. Local User Download
    1. #getsebool -a | grep ftp
    2. #setsebool -P ftp_home_dir on
    3. #yum install ftp
    4. #ftp localhost/<IP>
  3. Upload
    1. #vim /etc/vsftpd/vsftpd.conf
      1. Line 27, --> Uncomment
      2. anon_upload_enable=yes
    2. #mkdir /var/ftp/upload
    3. #chmod g+w /var/ftp/upload
    4. #chgrp ftp /var/ftp/upload
    5. Check the content,
      1. #ls -ldZ /var/ftp/upload      ---> public_content_t
    6. Change the content
      1. #chcon -t public_content_rw_t /var/ftp/upload
    7. Change the boolean
      1. #getsebool -a | grep ftp
      2. #setsebool -P allow_ftpd_anon_write on
    8. #service vsftpd restart
  4. Verification
  5. #cd /root
  6. #ftp localhost/<IP>
  7. #ls ---> pub & upload
  8. #cd upload
  9. #mput install.log
  10. Iptable Rules
    1. Clients outside example.com should not have access to your FTP service (IP & subnet will be given)
      1. #iptables -I INPUT ! -s example.com -p tcp --dport 21 -j REJECT


Saturday, 22 June 2013

Configuring File Services, FTP

#yum install vsftpd
#service vsftpd restart
#chkconfig vsftpd on


Note: Home/default directory of anonymous(unknown)/FTP user is /var/ftp/
Default user: FTP Password: FTP
FTP allows anonymous users to login, without password but it doesn't allow normal user to login with credentials.
Below is login with ftp/ftp

Now login with user subh/subh

FTP didn't allow access of home directory of normal user because  Selinux Booleans for 'ftp_home_directory' is 'off'.
Now we set Selinux Booleans for 'ftp_home_dir' to 'on'
#setsebool -P ftp_home_dir on    --> It takes time, as the change is permanent.
#getsebool  -a | grep ftp
Now we will try login ftp with user 'subh/subh:

To come out of FTP, use 'bye'