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


No comments:

Post a Comment