1752671 Members
5650 Online
108789 Solutions
New Discussion юеВ

Re: root passwor lost

 
SOLVED
Go to solution
aruns_s
Frequent Advisor

root passwor lost

Hi,
i forgot root password in one of the server.I can login as a normal user and use sudo to get root access.However, whwn I am trying to cahnge root password, it is asking for old root password which I forget
Please help how can I solve this with out rebooting the server.

regards
Arun
8 REPLIES 8
A. Clay Stephenson
Acclaimed Contributor
Solution

Re: root passwor lost

explicitly execute /sbin/passwd root
If it ain't broke, I can fix that.
aruns_s
Frequent Advisor

Re: root passwor lost

HI
If am using passwd root, it is asking for the old root password which I could not recall.Any other means?

regards
Arun
A. Clay Stephenson
Acclaimed Contributor

Re: root passwor lost

Then you will need to boot the box in single-user mode. You will then be root and can set the passwd.
If it ain't broke, I can fix that.
Adisuria Wangsadinata_1
Honored Contributor

Re: root passwor lost

Hi,

If you're not using trusted system, just simply edit /etc/passwd file (NOTE : copy first /etc/passwd to other directory for backup).

FROM :

root:8nvuu.Ki4lSO2:0:3::/:/sbin/sh

TO :

root::0:3::/:/sbin/sh

And after that, run command below :

# passwd root

Hope this information can help you.

Cheers,
AW
now working, next not working ... that's unix
njia_1
Trusted Contributor

Re: root passwor lost

Hi there

you said you can have root access by "sudo" here is a quick solution.

get root access and make sure you have write access to /etc/shadow file.

copy & paste the encrypted passwd from another system to this one

For example if this is the root entry in /etc/shadow of the system you have forgoten root passwd. Then just replace the "$1$t....AWPv/" part.

root:$1$tGqE/hYd$ijdjPK645e/MrlkDFAWPv/:12192:0:99999:7:::

if you do not have write access to /etc/shadow file, can you reboot it to single user mode ? then you should be able to change root passwd.
njia_1
Trusted Contributor

Re: root passwor lost

Hi there

regarding my previous reply, if your system is not a trusted sytem yet then you just need to change /etc/passwd file not /etc/shadow file.

thanks
aruns_s
Frequent Advisor

Re: root passwor lost

Hi
last I got the solution.
In a trusted system, individual password files are stored on /tcb/files/auth/r directory with a file name root.remove password field from this field as well as /etc/passwd.then we can issuew passwd command.thanks for all help.

regds
ARun
Indrajit_1
Valued Contributor

Re: root passwor lost

Hi;

You need to work in ISL mode to change ur password.. Do the following steps..

Reboot the machine and press Esc buttom in ur key board..

From the menu screen press a to go the administration access..

type boot isl pri

press yes ..

type..

hpux -is

it will take u to single user mode .. u can now change ur password..

passwd root ( change the root password)

Hope this will resolve ur issue.

cheers
indrajit
Never Ever Give Up