There was the easy way to reset the root password for CentOS. Please follow this steps and you will be able to access your CentOS.
1. Reboot the CentOS machine
2. When booting up, press any key to go into the select menu.
3. The press ‘e’ to navigate to second grub.conf line (kernel)
4. Once again press ‘e’ to edit the line and you can select one step from these option :
■ option 1 : 1 (’1′) at the end of the line. OR
■ option 2: S (‘S’) a the end of the line OR
■ option 3: add ‘single’ to “ro root=LABEL=/ single”
5. After edit, hit “ENTER”
6. Press ‘b’ to reboot
7. After reboot it will stop at ‘#’ command line.
8. At ‘#’ command line, type ‘passwd’ to create new password.
9. Reboot machine as usual
10 Finish
As always if you need any help you can reach us on twitter @ehowstuff or drop us a comment below.
1) Login as root user
2) Open /etc/inittab file using vi text editor or gedit GUI text editor
3) Look for the default runlevel called initdefault which look like as follows:
id:3:initdefault:
Please note that an initdefault entry specifies the runlevel which, should be entered after system boot. If none exists, init will ask for a runlevel on the console. The process field is ignored. Note number 3 in above line defines default runlevel.
4) Replace runlevel 3 to 5:
5) Save the changes
6) Reboot linux to take effect.
沒有留言:
張貼留言