ftp服务搭建详情

创建账号 useradd ftp
添加密码 passwd ftp
禁止ssh登陆 usermod -s /usr/sbin/nologin

cat /etc/shells  
/bin/sh
/bin/bash
/usr/bin/sh
/usr/bin/bash
/usr/sbin/nologin   #要添加这个,要不然,nologin的用户登录不了ftp

yum install vsftpd

配置文件

anonymous_enable=NO
local_enable=YES
write_enable=YES
local_root=/var/ftp/pub
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd/chroot_list
allow_writeable_chroot=YES

systemctl start vsftpd
systemctl enable vsftpd

完毕

原文地址:https://www.cnblogs.com/fanever/p/13529837.html