Ssh – cannot login via ssh

pamssh

Can not login to SLES server via ssh as user1. At the same time I can login as root user without any problem. Authentication method is password based. In /etc/ssh/sshd_config I have PasswordAuthentication yes.

node1:~ # ssh -v -v -v user1@node2 after entering password gives:

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:

The following log entries are present in the authorisation log file,

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

Best Answer

The problem was in PAM configuration file for sshd daemon /etc/pam.d/sshd. The raw within /etc/pam.d/sshd:

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

means that pam_listfile module will deny sshd service for all users listed in /etc/sshdusers