How to fix the root password under UNIX systems

Source: Internet
Author: User
Tags auth file system mkdir

The processing method of Solaris root password forgetting

1, if you can log in with a regular user,%df/etc, determine the name of the device containing the/ETC directory partition

%df/etc

//dev/dsk/c0t0d0s0 ...

In this case, C0t0d0s0, if your root partition device is different, you can replace it.

2, insert the system disk into the CDROM

3, refresh the file system using the Sync command after the prompt appears

4, press Stop+a

5, "OK" state type boot Cdrom-s

6, type mkdir/temp at the "#" prompt, and then type mount/dev/dsk/c0t0d0s0/temp

If there is a situation where the hook is not on, then run fsck to Fsck/dev/rdsk/c0t0d0s0 and then mount

7,cd/temp/etc

8,CP Shadow Shadowbak

9,cat Shadow

Get the password string for root

root:djglcj0j:6453::::(where djglcj0j is the encrypted password string of root)

10,sed s/djglcj0j//shadow>shadownew

11,cat Shadownew See if it has changed to

root::6453:::

12,CP Shadownew Shadow

13,CD/

Unmount/temp

Sync

Shutdown-i0-g0-y

14, after removing the CD, reboot the system, then root does not need the password!

That's OK!

OK Boot Cdrom-s

#TERM =sun

#export TERM

#mount/dev/dsk/c0t0d0s0/a

#vi/a/etc/shadow (Delete the encrypted password for root)

#reboot

Second: Restore SCO UNIX superuser password

Once the superuser password for the SCO UNIX machine has been forgotten, it can be solved by this method.

On another machine that has SCO UNIX installed, register with root, enter the system, use the FileSystem floppy filesystem manager in the Mkdev FD command or command scoadmin to make the emergency Startup disk. Includes boottable disk and root filesystem disk.

Install the above-made root filesystem disk on the hard drive.

# mount/dev/fd0135ds18/mnt

Then copy the/etc/passwd and/tcb/files/auth/r/root two files on the hard drive to the root filesystem disk.

# cp/etc/passwd/mnt

# cp/tcb/files/auth/r/root/mnt

Uninstall the floppy disk on the machine 1 hard disk.

# UMOUNT/DEV/RFD0135DS18

Use the boot floppy disk to start the forgotten password of the machine, according to the prompts to insert root filesystem floppy disk, to appear "#", do the following, the hard disk to hang to the floppy disk:

# mount/dev/hd0root/mnt

Back up the/etc/passwd and/tcb/files/auth/r/root two files on your hard disk. This is because the two files also contain registration information for other users.

Overwrite the two files on the hard drive with the two files on the root filesystem floppy disk/etc/passwd and/tcb/files/auth/r/root.

# MKDIR/CYH

# MOUNT/DEV/FD0135DS18/CYH

# CD/CYH

# CP Passwd/mnt/etc

# CP Root/mnt/tcb/files/auth

Uninstall the two file systems on the installation.

# Umount/dev/hd0root

# UMOUNT/DEV/FD0135DS18

Remove the floppy disk, reboot the machine, and when login appears, register with root and type the super user password for the second machine so that you can access the superuser.

After entering the superuser, overwrite the original file with the backup of passwd and root two files, then use the passwd command to modify the root password of the super user.

Users can use ALT+F2 to change a window to root registration, now with the modified password can be used.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.