centos 7 vsftpd服務器搭建及本地用戶linux
1.安裝vsftpd server端
yum install -y vsfptd
2.安裝ftp客戶端
yum install -y ftp
3.編輯配置文件/etc/vsftp/vsftpd.conf
sudo cp /etc/vsftp/vsftpd.conf /etc/vsftpd/vsftpd.conf.bak
sudo vim /etc/vsftpd/vsftpd.conf
local_enable=YES
write_enable=YES
local_umask=022
dirmessage_enable=YES
xferlog_enable=YES
connect_from_port_20=YES
xferlog_std_format=YES
ascii_upload_enable=YES
ascii_download_enable=YES
ftpd_banner=Welcome to FTP service
chroot_local_user=YES
ls_recurse_enable=YES
listen=YES
pam_service_name=vsftpd
userlist_enable=YES
local_root=/home/vsftpd
allow_writeable_chroot=YES
tcp_wrappers=YESvim
sudo useradd ftpuser -s /sbin/nologincentos
sudo echo "ftpduserpass" |passwd -stdin ftpuser服務器
4.建立ftp目錄
mkdir -p /home/vsftpd
chown -R ftpuser /home/vsftpd
chmod -R 755 /home/vsftpd
5.啓動服務
systemctl start vsftpd
systemctl enable vsftpd
6.放通防火牆
firewall-cmd --zone = public --add-port = 22/tcp --permanen
firewall-cmd --zone = public --add-port = 21/tcp --permanen
firewall-cmd --reload
7.測試
ftp localhostapp
username :ftpuser
password : ftpduserpasstcp
注:記得關閉selinuxide