Change the password of the root user of Debian

Source: Internet
Author: User

Now we generally use GRUB as the system bootProgramLilo's way to access a single user is very simple. I won't mention it here.

For some versions of OS (such as RedHat), edit grub and add "single" to enter the single-user mode. However, this method is invalid for Debian, because Debian requires you to enter the root user password when entering the single-user mode.

The following describesAll VersionsMethods available on Linux GRUB:

1. On the grub boot loader menu, select the entry you want to enter and type "E" to enter the editing mode.
2. In the second line (similar to kernel/vmlinuz-2.6.15 Ro root =/dev/hda2), Type E to enter edit mode;
3. Add "init =/bin/bash" at the end of the sentence and press Enter;
4. Press "B" to start the system.
In this way, we can get a bash shell.

After entering the shell, the Mount mode of the root partition is read-only by default. We need to change it to writable; otherwise, the root password cannot be changed:

Mount-No remount, RW/
Passwd Root
Sync
Mount-No remount, RO/
Reboot

In this way, the password of the root user of Debian can be changed successfully.

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.