Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Forget the password of the grup launcher CD repair mode virtual machine vmware8.04 Centos 6.3

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

In order to prevent others from changing the root password arbitrarily through grub, we need to set the password for the grub launcher, but what if we set the grub password and forget it? Can we only reinstall it again? It's not necessary. We can pass.

CD repair mode to solve this problem.

Environment: virtual machine vmware8.04 Centos 6.3

But before we start the CD repair mode, let's solve a problem, because I install Centos on the VMware virtual machine software. When using the Vmware virtual machine, I often encounter the situation that the boot screen is so fast that it is too late to press F2 to enter BIOS.

1 and I learned through the song 'some' that there is a virtual machine configuration file ending with the suffix ".vmx" in the directory where the virtual machine file is stored in Centos.

2 We can open the configuration file with notepad and add the line bios.bootDelay = "8000" and save it.

The next step is to check whether the virtual CD is connected. VM-- > Settings

4 confirm that you must hit the tick, otherwise it will be equivalent to no insertion of the CD, resulting in the inability to boot from the CD.

5 then restart the Centos in the virtual machine and press F2 in seconds to enter the BIOS interface

6 enter the BIOS interface, press the 'left arrow' to move to the Boot option, and press the 'down arrow' to move to the CD-ROM Drive

Then press' Shift' 'and' +'to make it the first startup item, and finally F10 MagneEnter determines to save and exit

7 below the screen when installing Centos, choose to repair the installed system

8 and then show a bunch of bird words

9 then ask which language you prefer to start in, it is best to choose English, press the tab key and press enter to confirm

10 ask which keyboard you want to use. You have no choice but to choose the us American keyboard. Press the tab key and press enter to confirm.

11 ask what kind of media you want to use for repair, of course it is Local CD/DVD, press the tab key and press enter to confirm

12 ask if you want to start the network, no, we are now repairing the system, not to play LOL!

NO, enter to confirm

13 said that the repair environment tried to find your LINUX installation device and mount it to the / mnt/sysp_w_picpath directory

Hey, do you dare to continue? Continue does not explain

14 says that your system has been mounted to the / mnt/sysp_w_picpath directory, press enter to enter shell. If you want to make your current system the same as the previous root directory, execute the chroot / mnt/sysp_w_picpath command. After you have finished all the work, the system will restart automatically when you execute the exit command to exit shell. Enter is sure.

15 ditto, do not explain, enter to confirm

16 start shell and press enter to confirm

17 Type chroot / mnt/sysp_w_picpath to change the home directory

18 next vi / boot/grub/grub.conf modifies the configuration file of grub

19 move to the line of passwor, delete the line directly by dd, and then save and exit

20 restart the virtual machine

At this point, the password for grub is gone.

If you accidentally delete an important configuration file, such as / etc/inittab, execute the command after step 17 as shown in the figure:

First, cd / root goes to the root directory, and then rpm-qf / etc/inittab queries which package the file belongs to by mistake.

After checking, you need mkdir / mnt/cdrom to create a mount point, and then mount / dev/sr0 / mnt/cdrom put / dev/sr0 this device

The file name is mounted to the empty / mnt/cdrom directory, and then

Rpm2cpio / mnt/cdrom/Packages/initscripts-9.03....i686.rpm | cpio-idv. / etc/inittab

Note:. / etc/inittab is'. At the beginning, cd to the root directory is also used to save the files extracted from the rpm package of the CD to the root directory

Then put it in its original location cp. / etc/inittab / etc/inittab, and finally exit,reboot

When rebooting, the first startup item should be set to Hard Drive to start normally.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report