Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do I reset my root password if I forget it?

System Recovery

How do I reset my root password if I forget it?

by  pcunix  Posted    (Edited  )
From,: http://pcunix.com/SCOFAQ/scotec1.html

First, you need emegency boot disks. If you don't have EBD's, you MAY be able to do this with your original install media (depends on the version).

If you don't even have boot media, see http://pcunix.com/SCOFAQ/scotec1.html#downloadboot


Then try these tips:



On some releases of OpenServer Release 5, boot from the boot diskette, and at the Boot: prompt, type

tools

This is not an undocumented option to the boot command, but rather a special line in /etc/default/boot on the installation diskette - so you can't use it from anywhere but your installation boot diskette.

See: http://stage.caldera.com/cgi-bin/ssl_reference/?105312

To get to your hard drive, you need to create the appropriate device node:

mknod /dev/root b 1 42
fsck -ofull /dev/root
mount /dev/root /mnt

See: http://stage.caldera.com/cgi-bin/ssl_reference/?105094

For older SCO Unix/Xenix/ODT releases, wait until the question early in the process that asks you what your keyboard type is. For character-mode installations, this is a regular textual prompt; for ODT, it's a box in a curses-style installation program. How to break out at this point depends on the OS. Under Xenix, press Del. Under Unix, type shell and press enter. Under ODT, press Control-A.

Once you have gained a prompt, you need to get at the hard drive. How to do this depends on the version you have:


This procedure will work for Xenix, and for Unix as well if you are using a very relaxed security level (one which stores encrypted passwords directly in /etc/passwd). If you're using a higher security level on Unix, see below.

Boot the system from your emergency boot diskettes (if you didn't make these and keep them up to date, shame on you, but you may be able to use N1/N2 instead, and see the entry on crashing out of these diskettesabove).

Next,
mount /dev/hd0root /mnt

; this will mount your hard drive's root filesystem on /mnt.

On some v5.0.x systems, /dev/hd0root won't exist. Create it with

mknod /dev/hd0r00t b 1 42

See also http://stage.caldera.com/cgi-bin/ssl_reference/?105094

Edit /mnt/etc/passwd. The first line will be your root line, such as

root:encryptedpasswordgoeshere:0:0:God,Everywhere:/:/bin/sh

Edit out the encrypted password (don't touch anything else!) so that the line reads something like

root::0:0:God,Everywhere:/:/bin/sh

Save the file and shut down. Reboot from the hard drive. Your root password has now been removed, and you can reset it normally.

Also see http://pcunix.com/Boot/defs.html#bootfloppy.

Higher security versions:

This is another procedure involving manually editing files, The location of the encrypted passwords depends on the security settings. Look in /etc/passwd, /etc/shadow, and /tcb/files/auth/r/root; one or more of these will be used depending on how you have security configured. Follow the procedure in part 1 above; instead of editing /etc/passwd, edit the appropriate file(s) from the above list, and delete the encrypted password field. Note that formatting is critical; while you can delete the contents of the field, you must not remove separators, and making seemingly minor errors such as leaving blank lines can cause problems. Save, shut down, and reboot. C2 security will complain about what you've done; to make it happy, run /etc/fixmog. You may also want to run /tcb/bin/integrity and /etc/tcbck.

Or:

This procedure will work for any variant of SCO Xenix or Unix. As above, boot from your emergency boot diskettes and

mount /dev/hd0root /mnt

to gain access to your hard drive's root filesystem. Now, run

/mnt/bin/chroot /mnt "/mnt/bin/passwd root"

(check the chroot man page for more info on how it works). As before, shut down and reboot. It has been reported that on 3.2v4.2 (and possibly others), this must be done in two steps:

/mnt/bin/chroot /mnt "/bin/su root"
passwd

If it doesn't work with the quotes, try it without.
Register to rate this FAQ  : BAD 1 2 3 4 5 6 7 8 9 10 GOOD
Please Note: 1 is Bad, 10 is Good :-)

Part and Inventory Search

Back
Top