2

My normal user account isn't working correctly in CentOS, but logging in as root works fine. What should I do to debug/fix the problem?

7
  • 2
    What happens when you try to login as a normal user? Commented Feb 1, 2011 at 6:32
  • 1
    What messages are in your logs (/var/log/security or /var/log/messages)?
    – Christian
    Commented Feb 1, 2011 at 7:30
  • 1
    also check /var/log/secure for login/pam errors.
    – jsbillings
    Commented Feb 1, 2011 at 14:11
  • how did you setup the user a/c?
    – yasouser
    Commented Feb 1, 2011 at 16:38
  • what is the output of passwd -S user? Commented Aug 24, 2011 at 18:57

3 Answers 3

3

Check the logs to see if there are any messages of note there. Try resetting your password, not saying you don't know it, but a reset will fix a couple possible issues. Then check your /etc/passwd file look for the line with your username on it and see if there is anything out of the ordinary i.e. your shell being set to 'nologin' or 'false'. Last you could remove the user acct and then add it back.

1
  • I'm with you and betting the password expired, something that doesn't happen to the root account.
    – user2267
    Commented Mar 26, 2011 at 15:51
1
  1. Check your logs (/var/log/messages, /var/log/security)
  2. Check your user has a valid login shell
  3. Check the output of faillog -u $USER (and reset with pam_tally)
  4. Check for the presence of /etc/nologin
  5. Check the output of chage -l $USER
  6. reset the password to a known, simple value and try again
  7. Post the details of what happenned when you ran through the steps above here and what is now appearing the logs
1
  • Indeed. I've seen a considerable number of systems with incompletely configured pam_tally, meaning that it doesn't properly reset after good authentication. Commented Dec 14, 2021 at 9:36
0

You may have not used the -p option in useradd, or maybe you were like me and supplied a plain text password with the -p option, thinking that would work. The best thing to try at this point is the passwd command. Its format is:

passwd [user]

where [user] is the account's username. You'll be asked to enter a new password and to verify it. For security purposes, the password will not be displayed as you type.

You must log in to answer this question.