1819774 Members
3459 Online
109607 Solutions
New Discussion юеВ

Reset Root password ??

 
Bedare Nikhil
Advisor

Reset Root password ??

Hello,

How can I reset/retreive the root password if I dont remember the root password?


Nikhil.
6 REPLIES 6
MarkSyder
Honored Contributor

Re: Reset Root password ??

Bring the system up in single user mode.

Mark Syder (like the drink but spelt different)
The triumph of evil requires only that good men do nothing
Peter Godron
Honored Contributor

Re: Reset Root password ??

Adam Noble
Super Advisor

Re: Reset Root password ??

Well u may have to go to single user mode and set it there. If it is a trusted system you could retrieve the tcb file from backup if you have one. If it is non trusted then you could retrieve the old password file to a new location and paste the password string into the existing passwd file. If you are root currently you don't have a problem u have a number of options such as nulling the tcb entry and then simply typing passwd. Is this the case?
Ganesh Balraman
Regular Advisor

Re: Reset Root password ??

Dear Sir,

Best option is single user mode.

ISL> hpux -is

Regds
B.Ganesh
Ranjith P B
Occasional Advisor

Re: Reset Root password ??

Hi Nikhil,

Boot the server to single usermod..for that

1.Interrupt autoboot by pressing any key
2.Give bo command on BCH prompt.
3.Select interact with ISL
4.At ISL prompt give hpux -is
sytem will boot into single user mode
mount usr filesystem
give passwd root
it will ask for new root password.


change the runlevel to the desired by INT command

Cheers,
Ranjith
Bill Hassell
Honored Contributor

Re: Reset Root password ??

There are very different answers to fixing the root password in single user mode. For non-trusted systems, you just use vi to edit the /etc/passwd file -- DO NOT use vi if there is a directory called /tcb. That means that your system is Trusted.

To use vi in single user mode, you need 3 directories mounted: /usr /tmp /var, and if you force a reboot, running the command: mount /usr wil report that you need to run fsck first. Use the raw device file listed in the error message. fsck all 3 filesystems and then mount them. Now vi will work. Delete text in the 2nd colon-delimited field so it looks like this:

root::0:0...etc...

Now root has no password and you can either run passwd now to change the root password, or issue the command:

init 3

to boot into normal user mode.

For Trusted systems, use the modprpw command as in:

/usr/lbin/modprpw -w "" root

(this is for 10.20 systems) For newer systems, the -w option was removed. In that case, you must use vi (setup the 3 lvols as above) and edit the file:

vi /tcb/files/auth/r/root

and change the line with u_pwd. It will look something like this:

:u_pwd=jEOrlatsNQvdg:\

to

:u_pwd=:\

That changes the root password to null. Now you can run the passwd command to set a new one, or change to init 3 and run passwd to change the root password.


Bill Hassell, sysadmin