1833873 Members
3076 Online
110063 Solutions
New Discussion

Forgot root password

 
Ngoh Chean Siung
Super Advisor

Forgot root password

Hi,

I already forgot the root password. Any solution?

regards.
10 REPLIES 10
A. Clay Stephenson
Acclaimed Contributor

Re: Forgot root password

You will need to shutdown / or simply power off if that's all you can do and bring the system up in single-user mode at the console.

Power-on and interrupt the boot by pressing when prompted. Next
BOOT PRI
Interact with ISL (or IPL) y

ISL> hpux -is

That will bring you up as root in single-user. You can then execute /sbin/passwd to set the root password.
If it ain't broke, I can fix that.
Sridhar Bhaskarla
Honored Contributor

Re: Forgot root password

Hi,

Have the application/database down on the system. Once you make sure that nothing other than the OS processes (owned by root) are running, then physically power off and on the system.

After the system completes diagnostics, it will give you 'n' seconds (usually 10 seconds) to stop booting. Press any key that time and it will put you to bootadmin prompt. Boot from the primary disk (bo pri) and when it prompts to interact with ISL, type 'y'. Boot process may be slightly different depending on the hardware you have. Once you are at ISL prompt type "ISL>hpux -is". It will bring single user mode. You can use either /sbin/passwd command (recommended) or edit /etc/passwd file (/tcb/files/auth/r/root in case of trusted system) and delete the encrypted password string. Then set the password using passwd command. THen run 'init 3' to bring it back to multi-user mode.

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ngoh Chean Siung
Super Advisor

Re: Forgot root password

Hi,

Is the below steps also works?

1. Ctrl-B, , , issue command: TC

2. Boot to Single User Mode

3. # modprpw -k root

4. # passwd root

If yes, what is the difference between the steps that u provided and the steps above?

regards
Sridhar Bhaskarla
Honored Contributor

Re: Forgot root password

Hi,

Yep. Instead of "tc", use 'rs' command. That's soft reset of the system. tc will dump the core which you don't need.

modprpw -k root is for trusted systems and if the root is disabled. If the system is not trusted and if you simply don't know the password, then use the procedures given above.

If you see the /tcb structure, (ll -d /tcb), then the system is trusted. So, once you are in single user mode do.

/usr/lbin/modprpw -k root

(change the password either by using passwd command or by deleting the encrypted string in /tcb/files/auth/r/root file).

-Sri
You may be disappointed if you fail, but you are doomed if you don't try
Ngoh Chean Siung
Super Advisor

Re: Forgot root password

Hi,

Due to I unable to login as root to shutdown the server properly, I have to shutdown the server manually by pressing the ON button. Is it the correct or any alternate way?

So after I reached the single user mode, I have to run fsck to repair all the file system and mount all the file system in order to use HP-UX comamnds (which is at /usr). Is it the process that must be go through whenever someone is forgot the root password?

regards.
Mauro Gatti
Valued Contributor

Re: Forgot root password

As far as I know... yes :-)
I did this operation from some time but I didn't find any data loss problem.
Ubi maior, minor cessat!
RAJESH GANGADHARAN
Regular Advisor

Re: Forgot root password

You can either swith off server, or issue a "rs" from your GSP. which will reset the system

Can you do a rlogin/remsh from any other server as "root"?

-Raj
Let the choices you make today be the choices you can live with tomorrow.
Ngoh Chean Siung
Super Advisor

Re: Forgot root password

Hi,

I have tried to rlogin but system prompt me to enter the password. Have not tried remsh. Actually what is rlogin and remsh for?

regards.
Mauro Gatti
Valued Contributor

Re: Forgot root password

If you didn't set before .rhosts and /or /etc/hosts.equiv you can't use rlogin without insert user's password!
Ubi maior, minor cessat!
Elif Gius
Valued Contributor

Re: Forgot root password

Hi,

for those worst cases it would be the best if you have installed ssh.
Thank you can connect to the server as root (if your public key is on the system)even if you don't knot the root password.

Maybe that's for the future.

Bye
Elif