1847239 Members
3241 Online
110263 Solutions
New Discussion

Re: Lost root password

 
Jessica Nguyen
Occasional Contributor

Lost root password

Hi all,

I couldn't log on root with the only password that I have. Please advise me how to be able to get to the system from root.

Thanks in advance
5 REPLIES 5
Patrick Wallek
Honored Contributor

Re: Lost root password

If you don't know the root password, there's not a whole lot you can do, but there are a couple of things.

1) Reboot the machine, go into single user mode, mount all of your root file systems and edit the passwd file and remove the root passwd. Then reset the passwd to something you know.

2) If you happen to have sudo installed and have a user set up that has all access, including su to root, then you can do a 'sudo su -' and get to root. If you don't have sudo, you can't install it without being root.

Other than that you're kind of stuck. As always, make sure you are typeing in what you thing you are. Make sure CAPS LOCK is not turned on. I know I've done that before.

Good luck.
Joanne Keegan
Regular Advisor

Re: Lost root password

I had the same problem the other day. All I needed to do was reboot into single user mode then issue the passwd command - which allowed me login afterwards with the new password.

Good luck,

Jo
leereg_5
Frequent Advisor

Re: Lost root password

Hi:
The answer depend on your OS:
If your use HP-UX:
Then reboot the machine and break it into single user mode, enter "hpux -is", then enter command " mountall" , then change the root passwd.
If you use Solaris:
Then you can upgrade your system with the CD.And change the root passwd upon the system ask for root passwd.


Hope this can help you!

Regards!
Always UNIX!
David Allen
Frequent Advisor

Re: Lost root password

Hi Jessica,

The following response is one I posted to another root password problem on this forum some time ago, it may have some relevance to your problem. Particularly if you have C2 security activated on your system and booting to single user mode requires the root password.

If the root account is disabled on a trusted system and single user mode requires the root password, try the following (this works for HP-UX 10.20, haven't tried it on an 11.0 server).

NOTE: Before powering off the server, manually shutdown all applications and databases, (hopefully these do not run as root!!!) as this will prevent possible data corruption, etc.

1. Power off the server

2. Insert the Recovery CD

3. Power server on, interrupt the boot process, select the CD device to boot from and interact with the IPL.

4. Type 800support (for servers) or 700support (for workstations)

5. Select [ Run a Recovery Shell ]

6. Exit to the shell prompt and mount the root ( / ) file system by typing the following, chroot_lvmdisk and follow the prompts (need to know the hardware path and device filename of the root disk).

7. Once the root file system is mounted (should be mounted on /ROOT), edit the password database for the root account.
NOTE: May need to load the vi, ex and libcurses.1 files before attempting to edit the following file.
cd /tcb/files/auth/r
cp root root.old
vi root
Remove the encrypted password string from the line that begins with :u_pwd= and save the file. The line should look like this after editing :u_pwd=:

8. Exit to the Recovery Menu and then reboot the server to single user mode. The system should request a login, type root and then just press ENTER for the password field (as it is blank). Reset the password as necessary.
Shahul
Esteemed Contributor

Re: Lost root password


Hi

Here are two options for U

Option 1

Reboot the system, While rebooting press and hold Esc key and go to ISL prompt. In ISL prompt, Type like this to go to single user mode.
ISL>hpux -is

Now U will get # prompt, There U can change the root passwd.

Option 2

If ur box is connected to Network and .rhosts file exists in /, U can rlogin to this machine from some other machine. But U should be root user in that machine.

Best of luck


Shahul