您现在的位置:首页 >关于我们 >行业新闻 >Linux中配置仅本地用户使用的服务器

Linux中配置仅本地用户使用的服务器

时间:2011年6月7日

  ftpusers和user_list文件中均包含一份FTP用户名的列表,两个文件虽然都用于FTP用户的控制,但具体作用存在一些差别。

  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

  mail

  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

  mail

  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文件服务器了。

本文由海腾数据(http://www.htidc.com)提供。网站关键词:服务器租用 | 服务器托管 | VPS主机 |  电信服务器租用 | 

Copyright© 2004-2020 河南海腾电子技术有限公司 版权所有   经营性ICP/ISP证 备案号:B1-20180452   豫公网安备 41019702002018号    电子营业执照