Solutions to password loss for various types of Unix and Linux

Source: Internet
Author: User
Article Title: solutions to password loss for various types of Unix and Linux. 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 ::::

(Djglcj0J is the encrypted password string of the root user)

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/
# 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.

  Iii. Lost Root Password of Aix4.3.3 (ibm) rs/6000

Place the first installation disk into the optical drive, restart the machine, press f5, and press 5 on the terminal to go to The maintance page. Select the mount rootvg function option, call password to modify the password, and exit.

 4. Freebsd's Root password is lost.

FreeBSD 4.7, when "boot... 9 seconds" is displayed, press any key and enter boot-s. After logon

#/Sbin/mount-
# Passwd

  5. Retrieve the Linux Root Password (Lilo/Grub)

Three methods:

1. When the system enters the single-user status, directly use passwd root to change it.

2. Install the CD boot system and run the linux rescue status to connect the original/partition as follows:


Cd/mnt
Mkdir hd
Mount-t auto/dev/hdaX (original/partition ID) hd
Cd hd
Chroot ./
Passwd root

This can be done.

3. Take the local hard disk and mount it to another linux system. The method is the same as that of the second one.

Rh8 Medium

(1) Lilo

1. Type linux single when the lil prompt appears. The screen displays the lil linux single.

2. Press enter to directly access the linux Command Line.

3. # vi/etc/shadow. Delete the content in the first line, that is, the content before "root:" and "Next", starting with "root". The first line is similar to "root:..." and "save.

4. # restart reboot. the root password is blank.

(2) Grub

1. When the grub screen appears, use the up and down keys to select the one you usually start linux (do not select dos), and then press the e key.

2. Use the up and down keys again to select the one you usually start linux (similar to kernel/boot/vmlinuz-2.4.18-14 ro root = LABEL =/), and then press the e key.

3. Modify the command line you see and add single. The result is as follows:


Kernel/boot/vmlinuz-2.4.18-14 single ro root = LABEL =/

4. Press enter to return, and then press the B key to start, you can directly enter the linux Command Line.

5. # vi/etc/shadow: Delete the first line, that is, the content in the line starting with "root", "root", and "Next". The first line is similar to "root: :...... save.

6. # restart reboot. the root password is blank.

6. Lost HP-UX Root Password

Press Esc at startup to enter isl. After Entering ISL:

Isl> bo pri
(Yes/no) y
Ipl> hpux-is
Ipl> vi/etc/passwd

Remove the root password.


 

Related Article

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.