Unix and Linux Password loss Solution

Source: Internet
Author: User
Article Title: Unix and Linux Password loss solution. Linux is a technology channel of the IT lab in China. Includes basic categories such as desktop applications, Linux system management, kernel research, embedded systems, and open source.

  1. How to Deal with the forgotten SolarisROOT Password

1. If you can log on with a common user, % df/etc, and confirm the device name that contains the/etc directory partition.

% Df/etc // dev/dsk/c0t0d0s0 ......

In this example, It is c0t0d0s0. If your root directory partition device is different, replace it with one.

2. Insert the system disk into the cdrom.

3. After a prompt appears, use the sync command to refresh the file system.

4. Press stop +.

5. In the "OK" status, type boot cdrom-s.

6. At the "#" prompt, type mkdir/temp and then mount/dev/dsk/c0t0d0s0/temp. If the connection fails, run fsck first fsck/dev/rdsk/c0t0d0s0 and then mount it.

7. cd/temp/etc.

8. cp shadow shadowbak.

9. Get the root password string through cat shadow.

Root: djglcj0J: 6453 ::::

(Where djglcj0J is the root encrypted password string) 10.sed s/djglcj0J // shadow> shadownew.

11. Run cat shadownew to check whether it has changed.

Root: 6453 ::::

12. cp shadownew shadow.

13. cd/

Unmount/temp sync shutdown-i0-g0-y

14. After removing the CD and restarting the system, the root user does not need a password!

This is also acceptable!

OK boot cdrom-s # TERM = sun # export TERM # mount/dev/dsk/c0t0d0s0/a # vi/a/etc/shadow (delete the root encrypted password) # reboot

  2. Restore the sco unix Super User Password

Once the Super User password of the sco unix machine is forgotten, you can use this method.

Run the mkdev fd command or command Floppy Filesystem Manager of Filesystem in scoadmin to create an emergency boot disk, including the Boottable disk and Root filesystem disk.

Install the created Root filesystem disk on the hard disk.

# Mount/dev/fd0135ds18/mnt

Copy the/etc/passwd and/tcb/files/auth/r/root files on the hard disk to the Root filesystem disk.

# Cp/etc/passwd/mnt # cp/tcb/files/auth/r/root/mnt

Detach a floppy disk from machine 1.

# Umount/dev/rfd0135ds18

Use the Boot floppy disk to start the machine that forgets the password and insert the Root filesystem floppy disk as prompted. When "#" is displayed, perform the following operations to mount the hard disk to the floppy disk:

# Mount/dev/hd0root/mnt

Back up the/etc/passwd and/tcb/files/auth/r/root files on the hard disk. Because these two files also contain registration information of other users.

Use two files on the Root filesystem floppy disk to overwrite the two files on the hard 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 installed file systems.

# Umount/dev/hd0root # umount/dev/fd0135ds18

Remove the floppy disk and restart the machine. When Login appears, register with the Root user and enter the superuser password of the second machine to access the Super User. After entering the superuser, use the backup files Passwd and Root to overwrite the original files, and then use the passwd command to modify the superuser password. You can use Alt + F2 for another window and register it as Root. Now you can use the modified password.

[1] [2] Next page

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.