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

Solutions to common and difficult problems in Linux system

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

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

This article mainly introduces "the solution to the common difficult problems of the Linux system". In the daily operation, I believe that many people have doubts about the solutions to the common difficult problems of the Linux system. The editor has consulted all kinds of materials and sorted out the simple and easy-to-use operation methods. I hope it will be helpful for you to answer the doubts of "the solutions to the common difficult problems of the Linux system". Next, please follow the editor to study!

1. Obtain root permission if you do not log in

If you do not set the GRUB password, then we can use the easiest method, first start the computer, wait for the GRUB menu, if the GRUB menu is hidden, you can press Esc to bring up, select Ubuntu, kernel 2.6.12 recovery mode, that is, the "recovery mode", just press Enter to start.

Another way is to use the Ubuntu installation disk to obtain root permissions, start the computer with the Ubuntu installation disk, and enter "rescue" when "boot:" is displayed.

Boot: rescue

Just follow the on-screen prompt.

2. Obtain root permissions by changing kernel startup parameters

Start the computer and wait for the GRUB menu. If the GRUB menu is hidden, you can press Esc to unlock it. If the GRUB password is set, press p to unlock it. For example, we select Ubuntu, kernel 2.6.12-8-386, press e to edit the startup parameters before startup, select kernel / boot/vmlinuz-2.6.12-8-386 root=/dev/hda2 ro quiet splash, press e to edit the selected startup menu item, and add rw init=/bin/bash at the end of the parameter. 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

Just press b to start.

3. Forgot the root user / primary user password

Follow the first item: without logging in, after obtaining root permission, enter on the command line:

Passwd root

Follow the prompts to enter the password twice to set the root user password, as shown in figure 1.

Figure 1

To change the primary user password:

Passwd system_main_username

Follow the prompts and enter the password twice.

4. Forget the password of the GRUB menu

Enter on the command line

Grub

When the prompt changes to grub >, enter:

Md5crypt

This is the MD5 value of the calculated password, that is, the encrypted value, and then enter the new password after prompting Password:

Password: * (ubuntu)

The system calculates the encryption value:

Encrypted: $1 $ZWnke0 $1fzDBVjUcT1Mpdd4u/T961

Press quit to exit, as shown in figure 2:

Quit

Figure 2

Then back up and edit the file menu.lst:

Sudo cp / boot/grub/menu.lst / boot/grub/menu.lst_backup

Sudo gedit / boot/grub/menu.lst

find

...

Password-- md5 $1 $gLhU0/$aW78kHK1QfV3P2b2znUoe/

...

Replace with

Password-- md5 $1 $ZWnke0 $1fzDBVjUcT1Mpdd4u/T961 (this is the encryption value we calculated above)

Just save the file.

5. Restore the GRUB startup menu after installing Windows

It often happens that we want to reinstall the windows system, but the reinstall will wash out the menu that starts Linux, which is a headache, and let's solve it like this:

First, according to the first item, use the Ubuntu installation disk to get root permissions, we assume that / dev/hda is the partition where / boot is located, and then enter at the prompt:

# grub-install / dev/hda

This way the grub-install program will install the grub menu for us.

6. Read Linux partition (ext2, ext3) in Windows

We can read the Linux partition in Windows with the software Ext2fs. The official home page of the software is http://www.fs-driver.org/index.html. The download address is: http://www.fs-driver.org/download/Ext2IFS_1_10b.exe program interface as shown in figure 3:

Figure 3

7. Some services start too slowly when booting up

Like Configuring network interfaces.... And Synchronizing clock to ntp.ubuntulinux.org... It may take a long time to start. For these services, we can use Ctrl+C to skip the startup of some services temporarily.

You can also run service settings: system-> system Administration-> Services, clear the check box for services such as "clock synchronization Service (ntpdate)", and then determine. As shown in figure 4:

Figure 4

8. Change the system time back from UTC (GMT)

If you set UTC (GMT) to be enabled when you install the linux system, there will always be an error of N hours between the system time and the local time whenever you restart to my windws partition. This is how I solve this problem under Ubuntu.

Edit the file / etc/default/rcS, and enter on the command line:

Sudo cp / etc/default/rcS / etc/default/rcS_backup

Sudo gedit / etc/default/rcS

find

...

UTC=yes

...

Replace with

UTC=no

Save the file and set it to the correct date and time in system-> system Administration-> date and time, as shown in figure 5:

Figure 5

Enter the following command restart time on the command line:

Sudo / etc/init.d/hwclock.sh restart

9. Configure sound for Flash

If there is no sound when you play Flash, enter this command on the command line:

Sudo ln-fs / usr/lib/libesd.so.0 / usr/lib/libesd.so.1

10. Forced emptying of the Recycle Bin

If you click to empty the Recycle Bin, but there is still garbage, you can run this command:

Sudo rm-fr $HOME/.Trash/

The recycle bin of Ubuntu Linux is a hidden folder, and under .Trash / in the home directory, the rm-fr command means forced, recursive deletion.

11. Clear the duplicates in the GNOME menu

If there are duplicates in the menu, which cannot be deleted as in windows, we need to start Applications Menu Editor: application-> system tools-> Applications Menu Editor, and delete the duplicates one by one. As shown in figure 6:

Figure 6

At this point, the study of "solutions to common and difficult problems in Linux systems" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

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

Servers

Wechat

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

12
Report