This discussion is archived
1 Reply Latest reply: Jan 8, 2013 3:31 AM by Dude! RSS

su incorrect password error

qazianeel Newbie
Currently Being Moderated
Hello friends,

I'm using RHEL 5, the problem I'm facing is that the su command doesn't work. If I logged in as root user I can switch to other user as it doesn't requires password but when I try to revert back to root account it gives me error "su : incorrect password ". Similarly I'm unable to switch from one user account to another.

I've tried some steps mentioned on other forums but none of them worked for me, like setting permission of on su command, password -u command to unlock accounts etc.

Someone recommended to change /etc/pam.d/su and /etc/pam.d/sshd but being newbie I don't know how to change them, the contents of these file are:

auth sufficient
# Uncomment the following line to implicitly trust users in the "wheel" group.
#auth sufficient trust use_uid
# Uncomment the following line to require a user to be in the "wheel" group.
#auth required use_uid
auth include system-auth
account sufficient uid = 0 use_uid quiet
account include system-auth
password include system-auth
session include system-auth
session optional
auth include system-auth
account required
account include system-auth
password include system-auth
session optional force revoke
session include system-auth
session required
Please help.

  • 1. Re: su incorrect password error
    Dude! Guru
    Currently Being Moderated
    The files /etc/pam.d/su and /etc/pam.d/sshd don't go bad by itself. I would not screw around with it unless you know exactly what you are doing. I suggest to leave the original files in place.

    Please provide an example including the complete commands and screen output you are using to demonstrate the problem.

    Are you running any background tasks that use the su command with incorrect or expired passwords that cause acounts to get locked?

    Btw, to return to the previous user from a su command you can simply exit, logout or use Ctrl-d.


  • Correct Answers - 10 points
  • Helpful Answers - 5 points