Debian Root Password Management (passwd: Command not found)

Source: Internet
Author: User

Step 1: After the blue grub interface is started, use the up and down keys to quickly move the cursor to the second line.

... (Recovery mode)

Step 2: press the letter "E" to enter the editing page. On the seventh line, there is a line of "Linux/Vm... single ".

Add "init =/bin/bash" at the end (quotation marks cannot be omitted)


Step 3: press Ctrl + X to start the system and enter root @ (none): command line mode.
Step 4: run the command to make the system readable and writable # Mount-No remount, RW/
Step 5: The command not found is displayed in passwd, VI, and vim.
Use Debian's default text editor nano to edit the first line (root line) of/etc/shadow ), back up shadow
# cd/etc
# cp shadow. bak
# nano shadow
modify the first behavior of shadow: Root: 15198: 0: 99999: 7 ::: (clear the root password)
press Ctrl + X and select YES to save.
Step 6: Change the system to read-only. # Mount-No remount, RO/
Step 7: log on to the server as a normal user. # su directly enters the root user (no password is required).
Step 8: Use # passwd to reset the root password.

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.