debian10 安装 vsftpd
安装
- 使用
sudo apt-get install vsftpd安装vsftpd
新增一个用户
- 增加用户
sudo useradd -md /home/user_name user_name - 设置用户密码
sudo passwd user_name
user_name 替换为用户名
配置文件中修改
vsftpd配置参考 vsftpd配置文件详解
允许读写操作write_enable=YES
修改 /etc/vsftpd.conf 限制所有用户访问其他目录,开放 /etc/vsftpd.chroot_list 中的用户访问其他目录(每行一个)
chroot_local_user=YES
chroot_list_enable=YES
chroot_list_file=/etc/vsftpd.chroot_list
配置此项后,登录可能会提示
# vsftpd:500 OOPS: vsftpd: refusing to run with writable root inside chroot()从2.3.5之后,vsftpd增强了安全检查,如果用户被限定在了其主目录下,则该用户的主目录不能再具有写权限了!如果检查发现还有写权限,就会报该错误。
修复方法:
- 在 /etc/vsftpd.conf 添加配置项 allow_writeable_chroot=YES
- 去除用户主目录的写权限
chmod a-w /home/user_name注意将 user_name 替换为用户名(此方法我未尝试)
记得修改目录权限