在Debian下配置VSFTPD以设置用户权限,可以按照以下步骤进行:
首先,确保你已经安装了VSFTPD。如果没有安装,可以使用以下命令进行安装:
sudo apt update
sudo apt install vsftpd
编辑VSFTPD的配置文件 /etc/vsftpd.conf
:
sudo nano /etc/vsftpd.conf
anonymous_enable=NO
local_enable=YES
write_enable=YES
chroot_local_user=YES
allow_writeable_chroot=YES
userlist_enable=YES
userlist_file=/etc/vsftpd.userlist
userlist_deny=NO
/etc/vsftpd.userlist
并添加允许登录的用户:sudo nano /etc/vsftpd.userlist
在文件中添加用户名,每行一个。为了更细粒度地控制用户权限,可以使用PAM(Pluggable Authentication Modules)。编辑 /etc/pam.d/vsftpd
:
sudo nano /etc/pam.d/vsftpd
确保以下行存在并且没有被注释掉:
auth required pam_listfile.so item=user sense=allow file=/etc/vsftpd.userlist onerr=succeed
account required pam_listfile.so item=user sense=allow file=/etc/vsftpd.userlist onerr=succeed
保存所有更改后,重启VSFTPD服务以应用新的配置:
sudo systemctl restart vsftpd
尝试使用FTP客户端连接到服务器,验证配置是否生效。你可以使用命令行FTP客户端或者图形界面的FTP客户端(如FileZilla)。
通过以上步骤,你应该能够在Debian系统上成功配置VSFTPD并设置用户权限。
辰迅云「云服务器」,即开即用、新一代英特尔至强铂金CPU、三副本存储NVMe SSD云盘,价格低至29元/月。点击查看>>
推荐阅读: Debian MySQL存储引擎选择