1 Reply Latest reply: Jan 8, 2013 5:31 AM by Catch-22 RSS

    su incorrect password error

    qazianeel
      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:

      */etc/pam.d/su*
      auth sufficient pam_rootok.so
      # Uncomment the following line to implicitly trust users in the "wheel" group.
      #auth sufficient pam_wheel.so trust use_uid
      # Uncomment the following line to require a user to be in the "wheel" group.
      #auth required pam_wheel.so use_uid
      auth include system-auth
      account sufficient pam_succeed_if.so uid = 0 use_uid quiet
      account include system-auth
      password include system-auth
      session include system-auth
      session optional pam_xauth.so
      */etc/pam.d/sshd:*
      auth include system-auth
      account required pam_nologin.so
      account include system-auth
      password include system-auth
      session optional pam_keyinit.so force revoke
      session include system-auth
      session required pam_loginuid.so
      Please help.

      Regards
        • 1. Re: su incorrect password error
          Catch-22
          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.