Link to home
Start Free TrialLog in
Avatar of logout
logout

asked on

Lost root passwd

If lost root passwd, how to get it?
If can't, need reinstall again?
But If no root passwd, how to change to
OK propmt?
Avatar of snydero
snydero

Can you restore /etc/passwd from a previous tape backup, then you will have the password from that time.
ASKER CERTIFIED SOLUTION
Avatar of alexhudghton
alexhudghton

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Except

a)You cannot restore file systems if you are not root

b)You will not be able to reboot to sungle user as you are not root.

You'll have to boot to single user from cdrom and change the password.
To get the machine to the ok prompt without the root password:

1)Make sure system is idle as possible- no nfs mounted filesystems, no users logged on etc etc.

2) Stop-A

3)At the ok type 'sync'

4)Hope no data has been shagged
1.  Stop A
2. sync
3. boot cdrom
4. go to install screen ,right click, select command window
5. mount /dev/dsk/c0t3d0s0 /a
    ( Do this as per your h/w configuration and mount to /a)
6. vi /etc/passwd
    delete the 'x'  mark of root line
    save it

7. reboot
 
AFAIK You do not have to boot from CDROM to get to single user - most (commercial) UNIX flavours will allow the boot process to be stopped to go to maintenance mode, boot from tape, run diags etc. It is at this point you can boot to single user - CDs or tapes are not (generally) required if the OS has already been installed. If the system is up then you are going to have to stop it. A method I have used many times is to get all users off the system then reset it - such that it simulates a system crash and takes a crash dump. Switching off the power is not a good idea but may well be the only way.

To everyone else - how do you know what hardware this guy has ?? Have I missed something ?? Its not the same for every type you know :-))
logout mentioned an ok prompt. Suggests Sun running Solaris to me.
pity he's not telling us what it is though :-) or responding at all !!