Retrieve the root password in Linux (excellent)

Source: Internet
Author: User

Linux root password retrieval methods
Linux Root has the highest power. Once the root password is forgotten or stolen, it is a headache. How can I retrieve the root password? I will summarize it as follows:
(1) Linux system password cracking

1. Press e in the grub option menu to enter the editing mode.
2. Edit the last line of the kernel with/init 1 (or/Single)
3. Press B to restart
4. Run the following command
Root @ # passwd root (configure the root password)
Enter new Unix Password: enter a new password
Root @ # init 6
(2) Debian Linux system password cracking

1. In the grub option menu 'debian GNU/Linux,... (recovery mode) ', press e to enter the editing mode.
2. Edit the RO single at the end of the kernel line and change it to RW single init =/bin/bash. Press B to restart.
3. Run the following command
Root @ (none) # Mount-
Root @ (none) # passwd Root
Root @ (none) # reboot

(3) FreeBSD system password cracking

1. boot to enter the boot menu
2. Select each item (Press 4) to enter the single-user mode.
3. Enter a command column.
Root @ # Mount-
Root @ # fsck-y
Root @ # passwd (password change command)
Root @ # root (username to crack the password)
Enter new Unix Password:
Root @ # init 6 (restart)

(4) Solaris system password cracking bitscn.com

1. Select the Solaris failasfe item in the grub option menu
2. The system prompts do you wish to have it mounted read-write on/? [Y, N,?] Select y
3. Enter the single-user mode.
4. Enter the following command
# Passwd
# New passwd: Enter the new password
# Re-enter new passwd: enter a new password
# Init 6 (restart) bitscn.com

(5) NetBSD system password cracking

1. Boot: When a prompt symbol appears and the last five seconds start, type the following command:
> Boot-s (command for entering single-user mode)
2. In the following prompt symbols
Enter pathname of shell or return for sh:
Press enter.
3. type the following command:
# Mount-
# Fsck-y
4. Use passwd to change the root password.
5. Use the exit command to enter the multiplayer mode.


(6) 1. On the grub boot loader menu, select the entry you want to enter and type "E" to enter the editing mode;

2. In the second line (similar to kernel/vmlinuz-2.6.15 Ro root =/dev/hda2), Type E to enter edit mode;

3. Add "init =/bin/bash" at the end of the sentence and press Enter;

4. Press "B" to start the system.

In this way, we can get a bash shell. after entering the shell, the Mount mode of the root partition is read-only by default. We need to change it to writable; otherwise, the root password cannot be changed:

Mount-No remount, RW/
Passwd Root
Sync
Mount-No remount, RO/
Reboot

In this way, the password of the root user of Debian can be changed successfully.


(7) 1. When Linux is started, press Ctrl + X, enter linux single or Linux 1 at the bash # prompt, and then
Bash # Enter passwd root to change the password!
2. when Linux is started, press Ctrl + X, enter Vi \ etc \ passwd at the bash # prompt, find root, and put the root: X :.... "X. The password is deleted!


(8)

1. About lilo
1. When lilo appears: Enter linux single
Lilo: linux single
2. Press enter to directly access the Linux Command Line
3. Use the PASSWORD command to change the password

Ii. About grub
1. When the grub screen appears, use the up/down key to select the item that you usually start Linux, 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 =/single
4. Press enter to return, and then press the B key to start, you can directly enter the Linux Command Line
5. Run the PASSWORD command to change the password.

(9) 1. Insert the system installation disc, restart the machine, and press the Del key during startup to enter the CMOs. Change the boot sequence to the disc to start first. In this way, the Linux installation program is started, press F5 and press the prompt to enter linuxrescue and press enter to enter rescue mode. Next, select the language and keyboard and press enter directly, the program prompts that the Linux system on the hard disk has been installed under/mnt/sysimage, and then a superuser prompt # appears #.
2. Go to the etc directory on the hard disk: CD/mnt/sysimage/etc. Do the backup first to prevent unexpected events:
Cpshadowshadow. old modify the properties of the shadow file to writable: chmod + wshadow and then use VI to modify it: Find the row containing the root user information: Root :.... :, the first two colons are the encrypted password, delete it (the colon cannot be deleted), and save the disk to exit. In this way, the root password is blank.
If you do not use Vi, you can use the following method: Find a DOS disk and insert it into the floppy drive. Copy the shadow to the DOS disk: mcopyshadowa:/And then modify it with the notepad in the attachment in windows, note that you must select all files (*.. Last copied back:
Mcopya:/shadowmnt/sysimage/etc
3. Change the shadow attribute to read-only: chmod-wshadow. Then, enter exit to exit and retrieve the disc.
4. For security reasons, add the password to the root user in the terminal window after restart.

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.