Retrieve the Linux superuser root password

  
. The author has the RedhatLinux7.2 operating system installed on the machine, and installed the KDE and GNOME desktops. Because the superuser root is only installed during the installation, the superuser's permissions are too large, only applicable to the system. Use when maintaining and installing software. Normal use should be logged in as a normal user. So you need to create a new normal user. This is also simple, open "Menu → System → Account Manager", add a user does not have it! Trouble can come: log in and then use root login, enter the password, ah! The password is wrong, can not enter the system. I know that the user password under Redhat7.2 is stored in /etc/shadow and should be used to find a breakthrough.

1, insert the system installation CD, restart the machine, press the Del button quickly when booting, enter the CMOS, change the boot sequence to the CD first, then start the Linux installation program, press F5, press the prompt to enter Linuxrescue Enter, enter the rescue mode, the next is to select the language and keyboard, you can directly press Enter, the program prompts that the Linux system on the hard disk has been installed to /mnt/sysimage, and then the super user prompt #.

2, enter the hard disk etc directory: cd /mnt /sysimage /etc, first do backup anti-failure:

cpshadowshadow.old modify the shadow file properties can be written: chmod + wshadow and then modified with vi: Find the line containing the root user information: root:....:, the encrypted password between the first two colons, delete it (the colon can not be deleted), save and exit. This way the root password is empty.

Users who do not use vi can take the following methods: find a DOS disk into the floppy disk drive, copy the Shadow to the DOS disk: mcopyshadowa: /then modify it with the notepad in the attached file under Windows, pay attention to open the file type Be sure to select all files (*.*) and save them. Finally, copy back:

mcopya:/shadowmnt/sysimage/etc

3. Change the Shadow property back to read-only: chmod-wshadow, and finally enter Exit to exit and remove the CD.

4. For security reasons, you should add a password to root in the terminal window after restarting.

Copyright © Windows knowledge All Rights Reserved