root password is not working for su in terminal
Solution 1
Probably you have locked the root user by too many wrong authentications. Try
usermod -U root
to unlock the account.
Solution 2
I had the same problem and none of the above replies helped. In my case, I could login as root, sudo
worked, but not su
.
It turned out that /bin/su
had somehow lost the suid permission.
I corrected that with chmod u+s /bin/su
, and then su worked again.
Solution 3
Make sure the user trying to su is in the wheel group.
$ id uid=1000(usr) gid=1000(usr) groups=1000(usr),10(wheel),18(audio),19(cdrom),35(games),442(plugdev),1003(pulse-access)
if you don't see wheel, your su will fail.
Or you can edit the su file in the /etc/pam.d directory and modify it to not require wheel group to be able to escalate your privileges.
Related videos on Youtube
vkGunasekaran
Trying to become a lazy developer and i believe in "Fixing the cause, not the symptom", loves bit of old fashioned stuffs... and i grouped my learnings here: web development scripts
Updated on September 18, 2022Comments
-
vkGunasekaran over 1 year
I'm using rhel 5, when i'm working in terminal first i typed su command and by mistake i entered copy command and some other characters, after realising i've made a mistake then i came out and continued with copy command in terminal.
after some time when i tried to login by using su and with password it says "incorrect password".
So i logged out and entered root login for gui and it works well, but i'm not able to use the same password for su.
can some one get around this issue?
-
Admin about 13 years@Carlos Campderrós first i tried to login using su, after typing 'su' instead of password i typed copy command ,then realised i mad a mistake and came out of it after that i continued my work. but after some time i again tried to login using su, it says 'incorrect password'. but meanwhile i didn't changed any passwords...
-
-
UselesssCat over 7 yearsMore than a complete hour trying to find this. I remember that i used chmod in the root folder changing the permission of all folders recursively :P, is a real miracle thats my debian stills working. thanks
-
SL5net almost 4 yearsi have the same problem. linux mint just installed. how you fix that ? how you could do
chmod u+s /bin/su
without this rights? -
SL5net almost 4 yearshow you could do thsis without admin rights?
-
ceving almost 4 years@SL5net You can't. Locking a account would not make much sense otherwise.
-
SL5net almost 4 yearsi just now installed LinuxMint fresh. 3times. same problem. do i need than change linux disto?
-
SL5net almost 4 yearsin the next attempt i used ubuntu. and didn't have this problem. the virtualbox extensions were even started automatically from the virtual cd.
-
Salem F over 2 yearsI was facing issue with
sudo
not withsu
,sudo
were not accepting my password, but when I login as root withsu root
entering my password accepted it and I issued the commandusermod -U root
and sudo works now, BTW I had script I run often used sudo but I add it toNOPASSWD
list invisudo