How to Change Single User Mode Password?

Aamod

New Member
Joined
Mar 13, 2020
Messages
2
Reaction score
0
Credits
0
Hello,

I want to change single user mode password other than root's password. ie. Password required to access Single User mode should be different to root's Password.

Thank you.
 


For CentOS 7

  1. Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server.
  2. As soon as the boot process starts, press ESC to bring up the GRUB boot prompt. You may need to turn the system off from the control panel and then back on to reach the GRUB boot prompt.
  3. You will see a GRUB boot prompt - press E to edit the first boot option. (If you do not see the GRUB prompt, you may need to press any key to bring it up before the machine boots)
  4. Find the kernel line (it starts with "linux16"), change ro to rw init=/sysroot/bin/sh.
  5. Press CTRL+X or F10 to boot single user mode.
  6. Access the system with the command: chroot /sysroot.
  7. Run passwd to change the root password.
  8. Reboot the system: reboot -f.
 
For CentOS 7

  1. Click [View Console] to access the console and click the send CTRL+ALT+DEL button on the top right. Alternatively, you can also click [RESTART] to restart the server.
  2. As soon as the boot process starts, press ESC to bring up the GRUB boot prompt. You may need to turn the system off from the control panel and then back on to reach the GRUB boot prompt.
  3. You will see a GRUB boot prompt - press E to edit the first boot option. (If you do not see the GRUB prompt, you may need to press any key to bring it up before the machine boots)
  4. Find the kernel line (it starts with "linux16"), change ro to rw init=/sysroot/bin/sh.
  5. Press CTRL+X or F10 to boot single user mode.
  6. Access the system with the command: chroot /sysroot.
  7. Run passwd to change the root password.
  8. Reboot the system: reboot -f.

Thank you Sir, for your reply.

Maybe you misunderstood my question.
I don't want to reset my root password. Whenever we go to single user mode it prompt us for root password.
I just want single user mode to prompt for password other than root user.
Example: If I go to single user mode it should prompt for user Tommy's password.

Thank you.
 

Members online


Top