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.

9

3 Answers

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.

17

On centos I had a user account that was 'locked' which I unlocked with the following:

faillock --user usernameGoesHere --reset
1

Based on the answer from Chris, I used this command on a similar issue, with success:

faillog --user usernameGoesHere --reset
2

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like