業務用エアコン関連の技術情報、エラーコード、環境問題対策に関する別サイト「エアコンの安全な修理・適切なフロン回収」

CentOS7.9 : FTP Server Install

FTP Server Installation

1. vsftpd install

# yum -y install vsftpd

2.vsftpd configuration

Save the unedited vsftpd.conf with .bak

# cp /etc/vsftpd/vsftpd.conf /home/huong/vsftpd.conf.bak
①Edit configuration file
# vi /etc/vsftpd/vsftpd.conf
●Line 12: No anonymous login (confirmed)
anonymous_enable=NO
●Line 40:Log transfer records (confirmation)
xferlog_enable=YES
●Line 83,84: Uncomment ( Allow transfer in ASCII mode )
ascii_upload_enable=YES
ascii_download_enable=YES
●Line 101,102:Uncomment ( chroot enabled )
chroot_local_user=YES
chroot_list_enable=YES
●Line 104: Uncomment ( chroot list file specified )
chroot_list_file=/etc/vsftpd/chroot_list
●Line 110: Uncomment ( Enable batch transfer by directory )
ls_recurse_enable=YES
●Line 115: Change (Enable IPv4)
listen=YES
●Line 124: 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
③Specify IP addresses to allow connections in /etc/hosts.allow

Write vsftpd:ALL (deny all connections) in /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
# systemctl enable vsftpd
Created symlink /etc/systemd/system/multi-user.target.wants/vsftpd.service → /usr/lib/systemd/system/vsftpd.service.
# systemctl start vsftpd
⑤From windows side, check if you can connect with FileZilla
Open ftp port with firewall before connecting
# 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 : (You can leave it blank.)
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.
 
Copied title and URL