白名单
1)修改配置文件“/etc/vsftpd/vsftpd.conf”中的参数“userlist_enable”,确保这个参数是yes
[root@localhost wj]# gedit /etc/vsftpd/vsftpd.conf //匿名登录
userlist_enable=YES
2)打开配置文件“/etc/vsftpd/vsftpd.conf“,在末尾追加一句话”userlist_deny=NO“。这个参数是NO,表示要设置一个白名单
[root@localhost wj]# lftp david:543092@192.168.0.113:8765 //用户david登录,密码是543092
userlist_deny=NO
3)编辑文件“/etc/vsftpd/user_list“,在末尾追加一句话要设置的用户名即可
[root@localhost ~]# gedit /etc/vsftpd/user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
root
bin
daemon
adm
nobody
david
4)重启服务,测试黑名单内的用户是否可以访问,上面列出的都是不可以访问的用户
[root@localhost wj]# service vsftpd restart //重启服务
===============================================================================================================
黑名单
1)修改配置文件“/etc/vsftpd/vsftpd.conf”中的参数“userlist_enable”,确保这个参数是yes
[root@localhost wj]# gedit /etc/vsftpd/vsftpd.conf //匿名登录
userlist_enable=YES
2)打开配置文件“/etc/vsftpd/vsftpd.conf“,在末尾追加一句话”userlist_deny=yes“。这个参数是yes,表示要设置一个黑名单
[root@localhost wj]# lftp david:543092@192.168.0.113:8765 //用户david登录,密码是543092
userlist_deny=YES
3)编辑文件“/etc/vsftpd/user_list“,在末尾追加一句话要设置的用户名即可
[root@localhost ~]# gedit /etc/vsftpd/user_list
# vsftpd userlist
# If userlist_deny=NO, only allow users in this file
# If userlist_deny=YES (default), never allow users in this file, and
# do not even prompt for a password.
# Note that the default vsftpd pam config also checks /etc/vsftpd/ftpusers
# for users that are denied.
root
bin
daemon
adm
nobody
david
4)重启服务,测试黑名单内的用户是否可以访问,上面列出的都是不可以访问的用户
[root@localhost wj]# service vsftpd restart //重启服务
===============================================================================================================