ftpusers和user_list文件中均包含一份FTP用戶名的列表,兩個文件雖然都用于FTP用戶的控制,但具體作用存在一些差別。
ftpusers文件:該文件中包含的用戶賬戶將被禁止登錄vsftpd服務器,不管該用戶是否在user_list文件中出現(xiàn)。通常將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文件中,就可以實現(xiàn)僅本地允許用戶使用的FTP文件服務器了。
本文由海騰數(shù)據(jù)(http://www.lbzs888.com)提供。網(wǎng)站關鍵詞:服務器租用 | 服務器托管 | VPS主機 | 電信服務器租用 |
海騰公告海騰數(shù)據(jù)最新新聞公告
Copyright© 2004-2020 河南海騰電子技術有限公司 版權所有 經(jīng)營性ICP/ISP證 備案號:B1-20180452
豫公網(wǎng)安備 41019702002018號
電子營業(yè)執(zhí)照