Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

System Recovery

How do I reset my root password if I forget it? by pcunix
Posted: 16 Dec 01

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


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).

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


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


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.


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"

If it doesn't work with the quotes, try it without.

Back to General UNIX discussion FAQ Index
Back to General UNIX discussion Forum

My Archive

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close