如果丢失root 密码或者 错误的删除/etc/group


Reset the root password on a linux box

Intro
The following steps were used to successfully reset the root password of a "Fedora 10" machine. In general, can be applied to any linux machine.


  1. GRUBWhile booting, after the initial splash and POST screen of the bios, the control transfers to GRUB. If there is just one linux operating system installed, the GRUB screen is bypassed to the booting screen, in that case just keep on pressing or tapping the ESC Button until you see the GRUB Menu.
  2. Edit Choose the OS you want to boot into and press "e" to edit.
  3. Edit Find the line that corresponds to kernel, and again press "e". Add the following line to the end of the line.
    single init=/bin/bash

    Then press enter, and then "b" to boot the OS. After booting you will get a root shell.

  4. Mounting the filesystem in readwrite mode: Type in the following command to remount the filesystem in read write mode.
    mount -o remount,rw / 

  5. Not doing this step might give the following error when running passwd, passwd: Authentication token lock busy.
  6. passwd Next just use the passwd command, and give a new root password, Now that's simple.

  7. Reboot or init 5

评论

热门帖子