Change the root password of debian

Source: Internet
Author: User
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.15roroot/dev/hda2), Type e to enter the edit mode; 3. add init/bin/bash at the end of the sentence, and press enter...

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:
//-W equals to-o rw.-o rw is mounted in read/write mode. -O sync is executed in synchronization mode. -O remount re-hangs an existing file system in different ways. For example, a previously read-only system can be re-mounted in the read-write mode.
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.

Author: "xiaoliangyu"

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.