FTP Server Installation
1. Vsftpd Install
1 |
# dnf -y install vsftpd |
2. Vsftpd configuration
1 2 |
Save the unedited vsftpd.conf with .bak # cp /etc/vsftpd/vsftpd.conf /home/huong/vsftpd.conf.bak |
①Editing Configuration Files
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 |
# vi /etc/vsftpd/vsftpd.conf ●Line 12: Anonymous login prohibited (confirmation) anonymous_enable=NO ●Line 39: Log transfer record (confirmation) xferlog_enable=YES ●Lines 82,83 Uncomment ( Allow transfer in ASCII mode ) ascii_upload_enable=YES ascii_download_enable=YES ●Lines 100,101: Uncomment ( chroot enabled ) chroot_local_user=YES chroot_list_enable=YES ●Line 103 Uncomment ( chroot list file specified ) chroot_list_file=/etc/vsftpd/chroot_list ●Line 109 Uncomment ( Enable batch transfer by directory ) ls_recurse_enable=YES ●Line 114 Change ( Enable IPv4 ) listen=YES ●Line 123 Change (IPv6 is ignored) listen_ipv6=NO ### Add to last line ### # Use local time use_localtime=YES |
②Add users to allow directory access to upper level
1 2 |
# echo "huong" >> /etc/vsftpd/chroot_list In my case I wrote huong. |
③Specify IP addresses to allow connections in /etc/hosts.allow
1 2 |
# echo "vsftpd:192.168.11.0/24" >> /etc/hosts.allow 192.168.11.0/24 is the setting that allows all local IP addresses in my environment. |
Write vsftpd:ALL (deny all connections) in /etc/hosts.deny
1 |
# echo "vsftpd:ALL" >> /etc/hosts.deny |
This setting overrides hosts.allow. That is, everything is denied, and IP addresses specified in hosts.allow are allowed.
④Enable vsftpd autostart and start it
1 2 3 4 |
# systemctl enable vsftpd Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service. # systemctl start vsftpd # is displayed, it is OK |
⑤Now, from windows side, check if you can connect with FileZilla.
Open the ftp port with firewall before connecting
Open the ftp port with firewall before connecting
1 2 |
# firewall-cmd --permanent --add-service=ftp # firewall-cmd --reload |
Start FileZilla and select "Site Manager" from the "File" menu.
Click on "New site"
Enter the following settings for each item and click "Connect"
Protocol : FTP-File Transfer Protocol
Host : Server IP Address
Port : (Blank)
Encryption : Use explict FTP over TLS if available
Logon Type : Ask for password
User : General user name (server login user)
Enter the following settings for each item and click "Connect"
Protocol : FTP-File Transfer Protocol
Host : Server IP Address
Port : (Blank)
Encryption : Use explict FTP over TLS if available
Logon Type : Ask for password
User : General user name (server login user)
Password : General user (server login user) password
If the connection is successful, the server directory is displayed on the right and the Windows directory on the left.