Sunday, 12 April 2015

FTP Anonymous (download only) Configuration on Rhel7/CentOS7

Ftp Server IP Address:

Note : All commands are to be executed as 'root' user 

Ftp Server Configuration:

1) Install FTP Server

          sudo yum install -y vsftpd

2) Create directory for anonymous access
            sudo mkdir -p /var/pub/data

3) Create file in /var/pub/data for sharing
          sudo touch /var/pub/data/foo1

4) Configure  SELinux permission on the directory /var/pub/data. Ftp requires the SELinux file type public_content_t
             sudo chcon -R -t public_content_t  /var/pub/data

5) Edit the directory for user 'ftp' in /etc/passwd
                  Edit the entry for user ftp
                             ftp:x:14:50:FTP User:/var/pub/data:/sbin/nologin

6) Open ftp service in firewall
            sudo firewall-cmd --zone=public --add-service=ftp --permanent
            sudo firewall-cmd --reload   

 7) Start Service
               sudo systemctl start vsftpd

 8) Enable on boot
                sudo systemctl enable vsftpd

 Ftp Client Configuration:

1) Install FTP Client
          sudo yum install -y lftp

2) Check the connection
               lftp localhost:~> ls
               -rw-r--r--    1 0        0            1238 Apr 11 10:29 foo1

No comments:

Post a Comment