Forgot Root Password "Give root password for maintenance"

To reset your root password:

1. When the GRUB loader shows during boot press the spare bar to pause boot.

2. Select your boot kernel.

3. Type 'e' to edit the default kernel line.

4. Type 'e' again on the line that starts with 'kernel'.

5. Add 'init=/bin/bash' to the end of the 'kernel' line then press enter.

6. Type 'b' to boot the modified kernel parameters.

7. Once you're at the /bin/bash prompt you will need to remount the root file system as read/write in order to edit the passwd file:

# mount -o remount,rw /

8. Change your root password:

# passwd root

9. Remount the filesystem back to read only:

# mount -o remount,ro /

10. Reboot your server using CTR-ALT-DELETE.

11. You will now be able to login with your new root password and carry out the maintenance.

  • 16 Users Found This Useful
Was this answer helpful?

Related Articles

How to Extend LVM Partition on CentOS

Caution: VMware recommends having a complete backup of the virtual machine prior making these...

How to increase Set max connection On Centos 6.x

for centos 6.x it is changed to the following codes : To print current limit type:# sysctl...

How to prevent Slowloris with iptables on CentOS

following this command line as root accessiptables -I INPUT -m state --state ESTABLISHED,RELATED...

How to Secure /tmp on CentOS แบบ image files

cd / dd if=/dev/zero of=/tmpfile bs=1 count=0 seek=4Gmkfs.ext4 -j /tmpfile mount -o...

SSH Key เข้าใช้งาน Linux Server ของ CentOS ด้วยโปรแกรม PuTTY

1. เข้าใช้งาน โดยการกรอก IP ของ Linux Server ที่ต้องการจะเชื่อมต่อ Port การใช้งานเป็น 22 2....