LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Security (https://www.linuxquestions.org/questions/linux-security-4/)
-   -   changing root password (https://www.linuxquestions.org/questions/linux-security-4/changing-root-password-426882/)

sunlinux 03-21-2006 06:05 AM

changing root password
 
I am in the mess. forget linux redhat 3.0 entr. server's root password. how can i recover it ?

spooon 03-21-2006 06:20 AM

You boot into single-user mode and use the "passwd" command to change (not recover) the root password. For more info:
* http://www.redhat.com/docs/manuals/e...ot-passwd.html
* http://linuxgazette.net/107/tomar.html

Simon Bridge 03-21-2006 06:24 AM

You can't. But there is good news... you can change it.
Code:

$ sudo passwd root
Otherwise, if you havn't enabled sudo, you will have to boot from a rescue CD. (CD1 or the DVD, "linux rescue" at the "boot:" prompt). This will boot you into single user mode.

From there you need to edit the /sys/image/etc/shadow file... look for the line starting "root:" It will look like this
Code:

root:$1$4m0pQ7wB$lWLD5xKy2hwb0IBJgXFSt1:13228:0:99999:7:::
... remove everything between the first two colons, so it looks like this:
Code:

root::13228:0:99999:7:::
... this will set a blank password.

Logout - login as root, hit enter for the password blank password), obtain a new root password (# passwd root)


All times are GMT -5. The time now is 03:50 AM.