3

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.

  • Are you sure you're entering the same password each time? Copy-and-paste it, don't retype it. – Keith Thompson Mar 4 '12 at 19:59
  • what means "login fails"? Please be verbose here... – Jörg Beyer Mar 4 '12 at 20:03
  • There is no /bin/false in the passwd file for this user. I am cutting and pasting the password. the Logins fails with "su: incorrect password – BillyCups Mar 4 '12 at 20:05
  • "su: incorrect password" is suspicious, since su is not part of the normal login. – Jörg Beyer Mar 4 '12 at 20:15
  • something that is interesting.. If I ssh from another box to this server and put in the correct password.. it instantly returns with "Connection closed by 22.22.22.22"... if I try to ssh in and on purpose put the wrong password, it says "Permission denied, please try again" so it knows the what the right password is ..it just won't let me in.. – BillyCups Mar 4 '12 at 20:18
4

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.

  • There is no /bin/false in the passwd for this user. I am cutting and pasting the password. the Logins fails with "su: incorrect password" – BillyCups Mar 4 '12 at 20:05
  • Try a simple password, just as a test. Something like 'abc123'. Does it work? Do not copy/paste in this simple test. – J. Bruni Mar 4 '12 at 20:07
  • I just tried qwer1234 as the password and still no luck :( I mean it supposedly sets the new password but still can't log in with it – BillyCups Mar 4 '12 at 20:09
  • I'd check /etc/ssh/sshd_config... related configs: PasswordAuthentication, UsePAM, KerberosAuthentication, AllowUsers... – J. Bruni Mar 4 '12 at 20:14
  • something that is interesting.. If I ssh from another box to this server and put in the correct password.. it instantly returns with "Connection closed by 22.22.22.22"... if I try to ssh in and on purpose put the wrong password, it says "Permission denied, please try again" so it knows the what the right password is ..it just won't let me in.. – BillyCups Mar 4 '12 at 20:19
6

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

faillock --user usernameGoesHere --reset
  • All other methods failed—only this did. Saved my Arch, thank you! – Andreï Kostyrka Dec 24 '20 at 15:53
1

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

faillog --user usernameGoesHere --reset
  • This is basically a copy of Chris' answer, but with even less explanation about the command. You probably had a good intention, but re-posting it isn't very helpful. If his answer worked for you, you should simply upvote his answer. =) – Vinícius M Feb 5 '19 at 15:50
  • I would very much like to, but I am 14 points from having access to upvoting and 49 points from commenting his post. And yes my intention was good, so if someone could add my 2 cents to Chris' answer I wouldn't mind. I would hate if someone was in my situation, and didn't manage to discover faillog instead of faillock :) – Jacob Helbo Kristensen Feb 6 '19 at 8:00

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.