Ubuntu forgot the root password _ resetting the initial root Password in Ubuntu _ detailed solutions

Source: Internet
Author: User
For windows operating systems, if you forget the administrator password, it would be a good solution. One of the simplest ways is to use PE, a computer store, and old Mao Tao to solve this problem perfectly. If it is a Linux operating system, it is actually very simple-single user login, the following describes several solutions. Method 1:
1. restart the system. When the system starts to the grub or lilo (usually grub) boot menu, find the current Boot item of the system (you can press the arrow key to expand the hidden menu)
2. Position the cursor on the option and press the "e" key to enter the editing status of the Guide;
3. This option has three lines of statements. Use the cursor to select the second line, that is, the line starting with "Kernel;
4. Press "e" on this line to enter the editing status of this line; BT4
5. Add a space at the end of the row and write the number 1, similar to this:
Kernel/boot/vmlinuz-2.6.9-11.19 ro root = LABEL =/1
6. After modification, press "enter" to return to the original interface;
7. Press the "B" key to start the guide.
In this way, the linux single-user mode can be started, which is a bit similar to the windows security mode, that is, only the most basic system is started, and network services and system services are not started. After the single-user mode guide is complete, a # prompt will be displayed, indicating that you already have Super User Permissions. Then, execute Command:
/Usr/bin/passwd
The system should prompt you to enter the password. This password is not displayed, so you can ensure that the input is correct. After you press enter, the system will ask you to enter it again. The input requirements are consistent, then you will see the prompt that the password is successfully modified. Enter the command init 3 and enter the system character interface mode (the system will change the running level again). the login prompt is displayed, try again to see if you can log on with the root account and the modified password.

Method 2:
If you have sudo permissions, you can directly run the following command:
# Sudo su root
# Passwd
# Change Password
You can also directly run The sudo passwd root command to change the root password.
Differences about sudo su:
1. Commonalities: root user permissions;
2. Differences: su only obtains the root permission, and the work environment remains unchanged. The user's work environment is still switched. sudo completely obtains the root permission and the root work environment.

Method 3:
1. Start the instance, as shown in figure (no virtual machine is installed, and the pictures taken by the mobile phone can be used together ):
2. There will be an option: Advanced Options for Ubuntu, select and press enter directly, for example:
3. There are many options in it. select the option with recovery mode (do not press ENTER !), Press the letter e, for example:
4. The key time is up. The last and fourth lines will show a line of linux/boot/vm... ro recovery \ nomodeset,
Step 1: Delete recovery \ nomodeset
Step 2: Add quiet splash rw init =/bin/bash at the end of this line
5. Press F10 to start.
6. If there is no accident, you will enter the system, enter passwd, and the system will prompt you to enter a new password to end.

Method 4:
If you do not have the sudo permission, method 1 is unavailable and you need to go to GRUB to modify the kernel image startup parameters. The ubuntu version 11.04 used in this article is as follows:
1. restart the computer's ESC key or F2 key to enter GRUB boot mode, as shown in. Select recovery mode in the second line.
2. Run the "recovery mode" command to compile the kernel for startup parameters.
3 Add quiet splash rw init =/bin/bash after linux/boot/vmlinuz. Then press ctrl + x to run the command directly.
4. After the command is run, the system directly enters the root mode. At this time, run the passwd command to change the password.

Method 5:
1. Insert the first optical disc into the optical drive and restart the system. After the boot is successful from the optical drive, enter linux rescue and press Enter.
2. Follow the Bootstrap program to go down without configuring the network. However, if you want to manually mount the system partition and select "yes", the system will go to the "#" prompt.
3. Run the command chroot/mnt/sysimage/(the default system will be mounted in the/mnt/sysimage/directory) on the Cisco router.
4. Run/usr/bin/passwd to modify the root password.
5. Execute the command exit, remove the disc, and restart the system. Then, log on to the system with a new password. You can fix the root password.
Related Article

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.