1863039 Members
1266 Online
110446 Solutions
New Discussion

Re: root passwd

 
khilari
Regular Advisor

root passwd

Hi guys, i have an issue. I logged into my system yesterday with root and today i cant use root login. other users can login, now i went into the single user mode and tried changing it. But when i do a
#passwd root
it asks for the old passwd and that is not working.And ya, i am sure i am in teh single user mode.... How should i fix this and secondly, what can be the reason of root passwd not working or getting changed overnight..
Thanks
4 REPLIES 4
Torsten.
Acclaimed Contributor

Re: root passwd

Sometimes strange things could happen if NUM or CAPS lock is on on the keyboard.
;-)
Is this a trusted system?
Do you have @ or # in your password?

Can you log on with a different user and "su"?

Hope this helps!
Regards
Torsten.

__________________________________________________
There are only 10 types of people in the world -
those who understand binary, and those who don't.

__________________________________________________
No support by private messages. Please ask the forum!

If you feel this was helpful please click the KUDOS! thumb below!   
Mike Shilladay
Esteemed Contributor

Re: root passwd

Hi,

You could try recovering the the security files. It sounds as though your system is trusted, so if you force a recovery of the /etc/passwd and everything in /etc/tcb from a known password backup, then you should be avble to log in as root using your old password.

Alturnatively, since you are logged in as root, (this again assumes the system is trusted) you could unset the trusted capability and reset you password, then set up the system to be trusted again. You will probably need to mount the OS filesystems before you un-trust the system, from single user mode.

Mike.
Mridul Shrivastava
Honored Contributor

Re: root passwd

If you want to reset the root passwd and you are in single user mode then do the following.

Take a backup of /etc/passwd file

cp -p /etc/passwd /etc/passwd.20071219

Then open /etc/passwd file using vi editor, you will find first line similar to the below one:
root:6RCmn/dxO3H9M:0:3::/:/sbin/sh

Delete the everything from the second field, it should look like as follows:
root::0:3::/:/sbin/sh

After this ur root password will be blank and that u can change at next login.

Above procedure will work if ur system is not a trusted system.
Time has a wonderful way of weeding out the trivial
Matt Hearn
Regular Advisor

Re: root passwd

If you ARE in a trusted system, and are already logged in as root, you can directly edit the TCB file at /tcb/files/auth/r/root. It'll have a line that looks something like this:

:u_pwd=3kj8j3kjfjKDj38:\

If you simply remove everything between the = and the :, so that it looks like this:

:u_pwd=:\

you now have an empty root password. After you save, just type "passwd" and it'll only prompt for the new one.

However if your root account insists that you reset the password on login before showing you a shell, you'll have to go to the console to do it.