Solution for forgetting the root password in Ubuntu

Source: Internet
Author: User

1. Get the root permission without logging on

If the GRUB Password is not set, we can use the simplest method. First, start the computer and wait for the GRUB menu. If the GRUB menu is hidden, Press ESC to call it up,
Select Ubuntu, Kernel 2.6.12-* (recovery
Mode), that is, "recovery mode", Press enter to start. Another method is to use the Ubuntu installation disk to obtain the root permission and start the computer with the Ubuntu installation disk.
"Boot:", enter "Rescue"

Boot: Rescue

Follow the on-screen prompts.

2. Get the root permission by changing the kernel startup parameters

Start the computer and wait for the GRUB menu. If the GRUB menu is hidden, Press ESC to call it up. If the GRUB Password is set, press P to unlock it. For example, if we select Ubuntu,
Kernel 2.6.12-8-386, press e to edit 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 Start Menu item, and add RW at the end of the Parameter
Init =/bin/bash, Which is changed 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

Start by B.

3. the root user/Master user password is missing.

Follow the first item: if you do not log on, after obtaining the root permission, enter the following command in the command line:

Passwd root follow the prompts and enter the password twice to set the root user password.

To change the primary user password:

Passwd system_main_username

Follow the prompts and enter the password twice.

4. Forgot the GRUB menu password.

Enter

After the grub prompt is changed to grub>, enter md5crypt.
This is the MD5 value of the calculated password, that is, the encryption value. Then, after prompted password:, enter the new password: Password: ***** (UBUNTU)
System Accountant calculated encryption value: Encrypted: $1 $ zwnke0 $1fzdbvjuct1mpdd4u/t961 quit by quit

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/$ aw78khk11_v3p2b2znuoe/

Replace

Password -- MD5 $1 $ zwnke0 $1fzdbvjuct1mpdd4u/t961 (this is the encryption value calculated above)

Save the file.

5. Restore the grub Startup Menu after installing windows

It is often the case that we want to reinstall the Windows system, but the Windows system will overwrite the menu to start Linux. This is a headache. We can solve it as follows:
First, follow the first item to use the Ubuntu installation disk to obtain the root permission. We assume that/dev/hda is the partition where/boot is located, and then input at the prompt:

# Grub-install/dev/hda

In this way, grub-installProgramThe GRUB menu will be installed for us.

6. Read Linux partitions (ext2, ext3) in windows. We can use the software ext2fs to read Linux partitions in Windows. The official homepage of the software is as follows:Http://www.fs-
Driver.org/index.html, which is:Http://www.fs-
Driver.org/download/ext2ifs_201710b.exe

7. Some services are too slow to start at startup.

For example, grouping network interfaces... and synchronizing clock
Ntp.w.tulinux.org... may take a long time to start. For these services, we can use Ctrl + C to temporarily skip the startup of some services at startup.

You can also run the service settings: system> System Management> service, clear and check services such as "Clock Synchronization Service (ntpdate)", and then confirm.

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

If you enable UTC (GMT) when installing the Linux system, the system time is always n hours different from the local time when the Windows partition is restarted. I solve this problem in Ubuntu.

Edit the/etc/default/RCS file and enter sudo CP/etc/default/RCS/etc/default/rcs_backup sudo gedit/etc/default/RCS in the command line.

Find

UTC = Yes

Replace

UTC = No

Save the file, go to system> System Management> date and time, set it to the correct date and time, and enter the following command restart time on the command line:

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

9. Configure sound for flash

If you play flash without sound, enter the following command in the command line:

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

10. Forcibly clear the recycle bin

If you have cleared the recycle bin, but there is still garbage, you can run the following command:

Sudo Rm-fr $ home/. Trash/

The recycle bin of Ubuntu Linux is a hidden folder. Under. Trash/in the main directory, the RM-fr command indicates forced and recursive deletion.

11. Clear repeated items in the gnome menu

If there are repeated items in the menu, you cannot delete them directly like in Windows. To start the applications menu Editor: Application> System Tools> Applications menu editor, delete repeated items one by one.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.