首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >FTP不允许/usr/sbin/nologin用户

FTP不允许/usr/sbin/nologin用户
EN

Server Fault用户
提问于 2012-02-09 09:40:05
回答 5查看 34.3K关注 0票数 14

我想为几个使用vsftpd的ftp用户设置ftp。我配置了FTP以启用本地用户访问。效果很好。但是,一旦我将用户的shell编辑为/usr/sbin/nologin,它就无法登录到FTP,其错误如下:

代码语言:javascript
复制
Response:   220 Welcome to the Scent Library's File Service.
Command:    USER marketftp
Response:   331 Please specify the password.
Command:    PASS ******
Response:   530 Login incorrect.

以下是我所做的:

  • 所有只有ftp的用户将/srv/ftp作为他们的主directory.The目录信息是/srv/ftp: drwxr-xr-x 3 root slftp 4.0K 2012-02-09 17:20 ftp/
  • 只有ftp的所有用户都将在slftp组中;我用adduser创建了用户,最后得到了/etc/passwd条目:marketftp:x:1001:1001::/srv/ftp:/usr/sbin/nologin,以及/etc/groupslftp:x:1001:marketftp中的这个。
  • vsftpd配置如下,以将用户限制在自己的家中,但vsftpd.chroot_list中的本地用户除外: chroot_local_user=YES chroot_list_enable=YES chroot_list_file=/etc/vsftpd.chroot_list

我的问题在哪里?由于FTP可以由普通本地用户登录,所以连接很好。但是为什么ftp用户不能登录呢?

EN

回答 5

Server Fault用户

回答已采纳

发布于 2012-02-09 10:43:32

取自这里

Q)救命!本地用户无法登录.

代码语言:javascript
复制
A) There are various possible problems.

A1) By default, vsftpd disables any logins other than anonymous logins. Put
local_enable=YES in your /etc/vsftpd.conf to allow local users to log in.

A2) vsftpd tries to link with PAM. (Run "ldd vsftpd" and look for libpam to
find out whether this has happened or not). If vsftpd links with PAM, then
you will need to have a PAM file installed for the vsftpd service. There is
a sample one for RedHat systems included in the "RedHat" directory - put it
under /etc/pam.d

A3) If vsftpd didn't link with PAM, then there are various possible issues. Is
the user's shell in /etc/shells? If you have shadowed passwords, does your
system have a "shadow.h" file in the include path?

**A4) If you are not using PAM, then vsftpd will do its own check for a valid
user shell in /etc/shells. You may need to disable this if you use an invalid
shell to disable logins other than FTP logins. Put check_shell=NO in your
/etc/vsftpd.conf.**

你是案例A4

票数 15
EN

Server Fault用户

发布于 2012-02-09 10:40:31

看看man vsftpd.conf中的vsftpd.conf:

代码语言:javascript
复制
Note! This option only has an effect for non-PAM builds of vsftpd.
If disabled, vsftpd will not check /etc/shells for a valid user
shell for local logins.

Default: YES

可以将/usr/sbin/nologin添加到/etc/shell中。简单易用的解决方案。

另一个是更改vsftpd.conf/PAM配置。

评论一下这个“奥斯.”PAM案例中的行:

代码语言:javascript
复制
$ grep shells /etc/pam.d/vsftpd
auth    required        pam_shells.so
票数 6
EN

Server Fault用户

发布于 2012-02-09 11:59:36

他们没有对自己的主文件夹的写访问权限。

(其RWX R-X R-X,所有者根,组slftp)

这通常足以阻止FTP的工作。

票数 0
EN
页面原文内容由Server Fault提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://serverfault.com/questions/358324

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档