在centos7下搭建ftp server
1、安装软件
yum install vsftpd
2、修改配置文件
目的:
1)将使用系统本地用户登陆
2)将用户锁定在其家目录下,不能随意切换
3)禁用匿名用户
anonymous_enable=NO local_enable=YES write_enable=YES local_umask=022 dirmessage_enable=YES xferlog_enable=YES connect_from_port_20=YES xferlog_std_format=YES chroot_local_user=YES chroot_list_enable=YES allow_writeable_chroot=YES chroot_list_file=/etc/vsftpd/chroot_list listen=YES pam_service_name=vsftpd userlist_enable=NO tcp_wrappers=YES
注意:
1)、从vsftpd 2.3.5 开始,chroot目录必须不可写,否则用户不能登录 若要解决该问题,可以新增一条参数: allow_writeable_chroot=YES
2)、默认/etc/vsftpd/chroot_list文件不存在,需要创建
3、启动vsftpd服务
systemctl start vsftpd
systemctl enable vsftpd
4、安装ftp客户端并测试登陆
yum install ftp lftp
useradd cs1
passwd cs1
lftp cs1@127.0.0.1