linux – FTP不允许/usr/sbin / nologin用户

前端之家收集整理的这篇文章主要介绍了linux – FTP不允许/usr/sbin / nologin用户前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我想为几个使用vsftpd的ftp用户设置一个ftp.我配置了FTP以启用本地用户访问.它工作正常.但是一旦我将用户shell编辑为/usr/sbin / nologin,就无法使用以下错误登录到FTP:
  1. Response: 220 Welcome to the Scent Library's File Service.
  2. Command: USER marketftp
  3. Response: 331 Please specify the password.
  4. Command: PASS ******
  5. Response: 530 Login incorrect.

这是我做的:

>所有ftp-only用户都将/ srv / ftp作为其主目录.目录信息是

/ srv / ftp:drwxr-xr-x 3 root slftp 4.0K 2012-02-09 17:20 ftp /
>所有ftp-only用户都将在slftp组中;

我用adduser创建了用户,最后得到了这个/ etc / passwd条目:marketftp:x:1001:1001 :: / srv / ftp:/usr/sbin / nologin

这在/ etc / group中:slftp:x:1001:marketftp
>使用以下命令配置vsftpd以将用户限制在他们自己的家中,但vsftpd.chroot_list中的本地用户除外:

  1. chroot_local_user=YES
  2. chroot_list_enable=YES
  3. chroot_list_file=/etc/vsftpd.chroot_list

我的问题在哪里?由于FTP可以由普通本地用户登录,因此连接正常.但为什么不能ftp-only用户登录

解决方法

取自 here

Q)帮助!本地用户无法登录.

  1. A) There are varIoUs possible problems.
  2.  
  3. A1) By default,vsftpd disables any logins other than anonymous logins. Put
  4. local_enable=YES in your /etc/vsftpd.conf to allow local users to log in.
  5.  
  6. A2) vsftpd tries to link with PAM. (Run "ldd vsftpd" and look for libpam to
  7. find out whether this has happened or not). If vsftpd links with PAM,then
  8. you will need to have a PAM file installed for the vsftpd service. There is
  9. a sample one for RedHat systems included in the "RedHat" directory - put it
  10. under /etc/pam.d
  11.  
  12. A3) If vsftpd didn't link with PAM,then there are varIoUs possible issues. Is
  13. the user's shell in /etc/shells? If you have shadowed passwords,does your
  14. system have a "shadow.h" file in the include path?
  15.  
  16. **A4) If you are not using PAM,then vsftpd will do its own check for a valid
  17. user shell in /etc/shells. You may need to disable this if you use an invalid
  18. shell to disable logins other than FTP logins. Put check_shell=NO in your
  19. /etc/vsftpd.conf.**

你是案例A4

猜你在找的Linux相关文章