SCO Unix Root Password

Adapted from the Unix Discussion Forum:

I want to know if there is any command to reset root password in SCO Unix. I'll be very grateful for the help.

This are the typical perms on a SCO dubba..

# ls -ld /tcb
8 drwxr-xr-x 5 root system 8192 Aug 10 02:28 /tcb
# ls -ld /tcb/files
8 drwxrwx--x 3 bin auth 8192 Aug 10 02:29 /tcb/files
# ls -ld /tcb/files/auth
8 drwxrwx--- 28 auth auth 8192 Oct 14 06:48 /tcb/files/auth
# ls -ld /tcb/files/auth/r
8 drwxrwx--- 2 auth auth 8192 Oct 14 07:00 /tcb/files/auth/r
# ls -l /tcb/files/auth/r/root
1 -rw-rw---- 1 auth auth 627 Aug 9 13:33 /tcb/files/auth/r/root

If you have any other logins coressponding to these owners of these files, su to them, rename the dir. recreate the root file,
(with a null password field) and simply log on!

Else:

First you need a SCO boot floppy with a minimal kernal, vi or ed, and mount on it. If you don't already have one, you can use a custom tailored Unix bootdisk for another UNIX (like Linux or FreeBSD) but this may a) not work or b) destroy your filesystem.

Boot the SCO from the boot disk and login to the default shell as root. At this point, none of the internal drives should be mounted.

Make a subdirectory on the floppy filesystem called recover or some such.
Mount the root partition of the drive to the recover subdirectory on the boot floppy in read/write mode.
You may have to use the FORCE mount option (which can KILL your root partition!) to get it to mount

After the root partition is mounted, it should be trivial to remove the password for the root account from the password table, save, unmount, reboot and remove the boot floppy.

Don't try to reset the root password, just clear out the password field.
Once you can bring the SCO back up (in single user!) then login as root, which may give you warnings but shouldn't ask for a password, and use the admin shell to set a new root password and rebuild the password file(s) correctly.

I have used a variant of this procedure to regain access to my firewall in similar circumstances.

Using a DOS driver for NTFS, much the same effect can be accomplished (with much more work) on an NT system.

Variants of this work for any system you can build the appropriate boot disk for. Also, afterwards, keep a spare "recovery" disk like this handy, but guard it well (i.e. a safe).

It is not a problem if you have emergency root and boot floppies for your SCO machines - if not, you are stuck. The only way around is to reload your os and reload your ''full'' system backups.

The problem lies in the fact that you need the root password to enter maintenance mode.

There are two ways to bypass the root password. The first is if the root entry in tcb is corrupt, and secondly if you have root and boot floppies so that you can purposely corrupt roots tcb entry.

I am going to assume that you do have a root and boot.

Firstly, as you cannot log in as root, power your system off.

Load the boot floppy into the drive and power on.

When prompted, load the root floppy.

At the prompt, check the bootdisk by:

# fsck -y /dev/hd0root

hd0root is a special device file purely for disaster recovery. Once fsck has finished, mount it

# mount /dev/hd0root /mnt

change to /mnt/tcb/files/auth/r rename root

# mv root root.old
# cd /
# umount /mnt
# halt

boot the machine.

When the machine comes up, sysinit is run from inittab and when it finds a problem with roots account, it starts up in single user mode without a password.

When you get control,

# cd /tcb/files/auth/r
# mv root.old root
# passwd root

Don't forget the password!

# cd /
# shutdown -y -go -i6

But of course, you need your emergency boot and root floppies!

I hope that this has been of some help to you.

P.S. SCO 5 is a lot easier as you can do it from the install media.

Have a Unix Problem
Do you have a UNIX Question?

Unix Books :-
UNIX Programming, Certification, System Administration, Performance Tuning Reference Books

Return to : - Unix System Administration Hints and Tips

(c) www.gotothings.com All material on this site is Copyright.
Every effort is made to ensure the content integrity.  Information used on this site is at your own risk.
All product names are trademarks of their respective companies.
The site www.gotothings.com is in no way affiliated with or endorsed by any company listed at this site.
Any unauthorised copying or mirroring is prohibited.