March 28 2016

CentOS 6 | Root Password Reset (GRUB Method)

Imagine the situation where your Administrator is fired/quits, and with him takes the root password of the server and need access to the server right now. Fortunately, Linux makes the process incredibly easy since you have local access, at least in the eyes of the Linux OS. All this method requires is the ability to manipulate GRUB, so if you have a way of seeing the grub menu and working with it, then this method is for you.

Let’s get started:

  1. Boot to the grub menu
  2. At the Grub menu press ‘e’ for edit.
  3. You should see 3 lines, scroll to the kernel line
  4. Using the Right Arrow, scroll to the end of that line
  5. Type the number “1” at the end and then hit “Enter”
  6. Now you’re looking at the 3 line again, hit ‘B’ to boot with this configuration
    1. Note: This is not saving the configuration, just booting you into Single User Mode for this session.
  7. You should now be booted into Single User Mode with Root access. Change the password with the “passwd” command
    1. # passwd
  8. Reboot the server with the “reboot” command

This method is great for 1&1’s Dedicated Servers using the Serial Console, 1&1’s Cloud Servers using either the KVM/VNC console, and Digitalocean’s KVM console. As long as you can see GRUB, you can change the root password.



Copyright 2020. All rights reserved.

Posted March 28, 2016 by timgarrity89_a1y6u17p in category "1&1 Internet", "CentOS", "DigitalOcean", "Linux", "Providers", "Tutorials

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.