Retrieve the root password of a Linux Super User

Source: Internet
Author: User
Article Title: retrieve the root password of a Linux Super User. 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.

The author installed the RedhatLinux7.2 operating system on the machine and installed the KDE and GNOME desktops. Because only the superuser root was set during installation, the superuser permissions were too high, it is only applicable to system maintenance and software installation. Common users should be used for logon. Therefore, you need to create a common user. This is also simple. Open "menu> system> account manager" and add a user! This is troublesome: log out and use root to log on. Enter the password! The password is incorrect and cannot enter the system. I know that the user password in Redhat7.2 is saved in/etc/shadow. We should find a breakthrough here.

1. Insert the system installation disc, restart the machine, and quickly press the Del key during startup to enter the CMOS, and change the startup sequence to the disc to start first. In this way, the Linux installation program is started, and press F5, press Linuxrescue and press enter to enter the 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, then the superuser prompt #.

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 attributes of the shadow file to writeable: chmod + wshadow and then use vi to 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. To ensure security, 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.