|
ftpusers文件:该文件中包含的用户账户将被禁止登录vsftpd服务器,不管该用户是否在user_list文件中出现。通常将root、bin、daemon等特殊用户列在该文件中,禁止用于登录FTP服务。默认如下所示:
[root@linux-01 ~]# cat /etc/vsftpd/ftpusers
# Users that are not allowed to login via ftp
root
bin
daemon
adm
lp
sync
shutdown
halt
news
uucp
operator
games
nobody
user_list文件:该文件中包含的用户账户可能被禁止登录,也可能被允许登录,具体在vsftpd.conf主配置文件中决定。默认如下所示:
[root@linux-01 ~]# cat /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
lp
sync
shutdown
halt
news
uucp
operator
games
nobody
当存在“userlist_enable=YES”的配置项时,user_list文件生效,如果配置“userlist_deny=YES”,则仅禁止列表中的用户登录,如果配置“userlist_deny=NO”,则仅允许列表中的用户登录。
配置主配置文件
在主配置文件中把anonymous_enable=YES改成NO,添加“userlist_deny=NO”配置项,并把允许访问的用户添加到user_list文件中,就可以实现仅本地允许用户使用的FTP文件服务器了。