Solution to intractable diseases

  

Computer store news:

If anyone says that his Linux has never encountered "difficulty", I think it is not credible, even the most user-friendly interface Windows XP also often encounters a variety of problems, and some problems are really only solved by replacing the hardware! Linux is also like this, and his freedom is to increase the frequency of problems. Of course, because of the characteristics of Linux open source, no matter what the problem, you can find the crux of the source code level, which is the charm of Linux.

1. Get root privileges without logging in.

If the GRUB password is not set, then we can use the easiest way to start the computer and wait for the GRUB menu if the GRUB menu is hidden. , you can press Esc to select, Ubuntu, kernel 2.6.12-*-* (recovery mode), that is, "recovery mode", press Enter to start. Another way is to use the Ubuntu installation disk to gain root privileges, use the Ubuntu installation disk to start the computer, when the display "ld:; boot:", enter "ldquo; rescue",

boot: rescue

The screen prompts the operation.

2, by changing the kernel boot parameters to obtain root permissions

Start the computer, wait for the GRUB menu, if the GRUB menu is hidden, you can press Esc to call out, if you set the GRUB password, press p to unlock For example, we chose Ubuntu, kernel 2.6.12-8-386, press e to edit the boot parameters before starting, select kernel /boot/vmlinuz-2.6.12-8-386 root=/dev/hda2 ro quiet splash, press e Edit the selected boot menu item, add rw init=/bin/bash at the end of the parameter, and change to the following command line:

grub edit> kernel /boot/vmlinuz-2.6.12-8-386 Root=/dev/hda2 ro quiet splash rw init=/bin/bash

Press b to start.

3, forgot the root user /primary user password

According to the first item: After not logging in, after obtaining root privileges, enter at the command line:

passwd Root Follow the prompts and enter the password twice to set the root password, as shown in Figure 1.



Figure 1

To change the primary user password:



passwd system_main_username< Br>

Follow the prompts and enter the password twice.

Copyright © Windows knowledge All Rights Reserved