Thursday, September 4, 2014

Incorrect password for Linux user even after changing it


I am unable to log into a regular user account using a password, so I first change the password to something I know...
As root,


passwd  theUser

put in the password: thepassword


it states it updates successfully



passwd: all authenication tokens updated successfully



I then can


su - theUser

and Im now this user..I try


su - theUser

it asks me for the password,I put in the one I just assigned to it and it fails with


su: incorrect password

I even try to ssh into the box with that user and the password still fails.


Answer



There are several places to check.



  • /etc/passwd - maybe the user has not access to a "valid shell"; if the line corresponding to this user ends with /bin/false, then this user does not have access to the command-line shell


  • /etc/hosts.allow and /etc/hosts.deny - access control


  • /etc/ssh/sshd_config - ssh configuration


  • /etc/security/access.conf - security setting


  • /etc/pam.d/sshd and /etc/pam.d/system-auth-ac - PAM settings



Using ssh -vv for verbose output may help.


And a user reported that reinstalling ssh resolved his issue.


No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...