无法通过 ssh 登录

无法通过 ssh 登录

无法通过 ssh 以 身份登录 SLES 服务器user1。同时,我可以以root用户身份登录,没有任何问题。身份验证方法是基于密码的。在 中,/etc/ssh/sshd_config我有PasswordAuthentication yes

node1:~ # ssh -v -v -v user1@node2输入密码后显示:

Password:
debug3: packet_send2: adding 32 (len 17 padlen 15 extra_pad 64)
debug1: Authentications that can continue: publickey,password,keyboard-interactive
debug2: userauth_kbdint
debug2: we sent a keyboard-interactive packet, wait for reply
debug2: input_userauth_info_req
debug2: input_userauth_info_req: num_prompts 1
Password:

授权日志文件中存在以下日志条目,

Jul 6 13:44:37 node2 sshd[23303]: pam_listfile(sshd:auth): Refused user user1 for service sshd 
Jul 6 13:44:39 node2 sshd[23294]: error: PAM: Authentication failure for user1 from node1

答案1

问题出在 sshd 守护进程的 PAM 配置文件中/etc/pam.d/sshd。原始文件如下/etc/pam.d/sshd

auth  required pam_listfile.so item=user sense=deny file=/etc/sshdusers onerr=succeed 

意味着pam_listfile模块将拒绝sshd为以下列出的所有用户提供服务/etc/sshdusers

相关内容