CentOS 5 Forgot Password Processing Method

  
 1. When the grub screen appears, use the up and down keys to select the one you normally want to start linux, then press the e key 2. Use the up and down keys again to select the one you normally start linux (similar to kernel /boot/vmlinuz-2.4 .18-14 ro root=LABEL=/), then press e. 3. Modify the command line you see now, add single, the result is as follows: kernel /vmlinuz-2.6.18-8.el5 single ro root=LABEL= /rhgb quiet 4. Press Enter to return, then press b to start, you can directly enter the Linux command line 5. #vi /etc/shadow The first line, that is, the line starting with root, root: after and next: before The content is deleted, the first line will be similar to root::...... Save (if it can't be saved, it is a file attribute problem, just chmod 755 /etc/shadow, this will be OK) 6. #reboot restart, The root password is empty

The author's machine is equipped with Redhat Linux 7.2 operating system
, and the KDE and GNOME desktops are installed, because only the super user root is set during installation, but the superuser's permissions are too large. It is only suitable for system maintenance and software installation. 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 & rarr; system & rarr; account manager & rdquo;, add a user does not have to! Can trouble things come: log out and then use root login, enter the password, ah! password error, enter No more. 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 Linux rescue 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: cp shadow shadow.old modify the shadow file properties can be written: chmod + w shadow and then modify with vi: find with root The line of 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 drive, copy the Shadow to the DOS disk: mcopy shadow a: /Then modify it with the notepad in the attached file under Windows
, pay attention to open the file type must select all files (*.*), save and exit. Finally, copy back: mcopy a:/shadow mnt/sysimage/etc 3. Change the Shadow property back to read-only: chmod -w shadow, 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 rebooting.

Copyright © Windows knowledge All Rights Reserved