FTP não permite usuário / usr / sbin / nologin

5

Eu quero configurar um ftp para alguns usuários somente com ftp vsftpd . Eu configurei o FTP para habilitar o acesso do usuário local. Funciona bem. Mas depois de editar o shell dos usuários em /usr/sbin/nologin , ele não pôde efetuar login no FTP com o seguinte erro:

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.

Aqui está o que eu fiz:

  • Todos os usuários apenas com ftp terão /srv/ftp como seu diretório inicial. As informações do diretório são

    /srv/ftp: drwxr-xr-x 3 root slftp 4.0K 2012-02-09 17:20 ftp/

  • Todos os usuários somente para FTP estarão no grupo slftp ;

    Eu criei o usuário com adduser e acabei com essa /etc/passwd entry: marketftp:x:1001:1001::/srv/ftp:/usr/sbin/nologin

    E isso em /etc/group : slftp:x:1001:marketftp

  • O vsftpd é configurado com o seguinte para limitar o usuário a sua própria casa, exceto os usuários locais no vsftpd.chroot_list :

    chroot_local_user=YES
    chroot_list_enable=YES
    chroot_list_file=/etc/vsftpd.chroot_list
    

Onde está o meu problema? Como o FTP pode ser logado por usuários locais normais, a conexão é boa. Mas por que o login do usuário somente FTP não poderia?

    
por steveyang 09.02.2012 / 10:40

4 respostas

6

Extraído de aqui

Q) Ajuda! Usuários locais não podem efetuar login.

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.**

Você é o caso A4

    
por 09.02.2012 / 11:43
3

Veja o check_shell no man vsftpd.conf:

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

Você pode adicionar / usr / sbin / nologin a / etc / shells. Solução simples e fácil.

Outra é alterar a configuração do vsftpd.conf / PAM.

Comente esta linha "auth ..." no caso do PAM:

$ grep shells /etc/pam.d/vsftpd
auth    required        pam_shells.so
    
por 09.02.2012 / 11:40
0

Eles não têm acesso WRITE à sua própria pasta pessoal.

(Seu RWX R-X R-X , proprietário raiz , grupo slftp )

Isso geralmente é motivo suficiente para impedir que o FTP funcione.

    
por 09.02.2012 / 12:59
-1

Eu coloco /usr/sbin/nologin em /etc/shells e vsftpd funciona bem.

    
por 01.12.2016 / 16:22