How to Reset Root Password without reboot


#1

Hello All

We have a Production Server running (RHEL 6.5) .We have 2 sudo users and root user. For installing monitoring agents we should have root access but we have lost the root user password. Would anybody tell me how to reset the root user password without reboot because the server in production environment.

Any Help would be appreciated

Thanks!!!


#2

Use the user that has “sudo” access and run:

sudo passwd root

#3

Hi Marin

Thanks for your reply…

but my sudo users doesn’t have privileges to reset the root user password


#4

What privileges the sudo users have? Can they edit the /etc/shadow file?


#5

Hi,

If you did not define some root privileges for normal user ,you can not change password of root other than try and try to guess root password…


#6

@MarinT sudo users couldnot edit /etc/shadow file


#7

@jalal_hajigholamali

Thanks for your valuable suggestions


#8

I think the last chance is to hack your own system if possible…
Search the web for an exploit then copy it to your server and compile it and execute it… However I think it’s the worst way especially for an operational and sensitive server therefore I prefer to reboot the server and bring it up in single user mode…

Regards,
Sepahrad


#9

I don’t think that we can able to reset root password without reboot and I am damn sure isn’t any way. The only solution is to switch to single user mode and reset the root password


#10

As you said it is a production server,we cant appreciate using exploit. However,I will try this on my personal Workstation.

Thanks for your valuable suggestions


#11

Yes, We had got the Downtime from the Customer. And Reset the Password through the single user mode.

Thanks for your comments, ravi


#12

list out the sudo privilages which assigned to user


#13

login with user which have sudo privileges and type “sudo su -” give the user password now you can run “passwd root” change the password…

Thanks