Baza znanja

How To Reset the Root User Password from Rescue Mode  Ispiši članak

If you've forgotten the root password for your Linux system, resetting it in rescue mode is a valuable troubleshooting step.

Rescue mode allows you to access your system in a minimal environment, which enables you to reset the root password.

This step-by-step tutorial will guide you through the process.

First you need to enable rescue mode from VPS Control Panel.

Guide : How to enable Rescue Mode

After you have enable rescue mode for your VPS, access it using ssh/putty.

You need to first Mount the Root Filesystem. Then, execute the following commands:

To identify your root partition, run the fdisk -l command. Your root partition is typically named /dev/sda1, /dev/nvme0n1p1, or a similar designation.

Mount the root partition to /mnt
mount /dev/sdXY /mnt

Use the root partition you identified in the previous step to replace /dev/sdXY

Chroot into the Root Filesystem

Now you must modify the root environment to your actual system's root filesystem. This is done with the chroot command:

chroot /mnt

Reset the Root Password

Once the root filesystem is mounted and chrooted, you have the capability to reset the root password. This can be achieved by using the passwd command.

passwd

When prompted, you will be asked to enter a new root password. Once you have set the new password, you will likely receive some password-related messages confirming that the password has been updated successfully. 

Unmount and Reboot

Exit the chroot environment:

exit

Now, unmount the root partition:

umount /mnt

Finally, reboot your system:

reboot

After that, disable rescue mode from VPS Control Panel.

Now you should be able to access your VPS using the new password which you have set.

Je li Vam ovaj odgovor pomogao?

Vezani članci

How To Activate Windows Server 2012 R2 Trial License
Hi Thank you for choosing service from Host4Fun . Go to run > cmd > slmgr.vbs /rearm and...
How to enable ping response on Windows Server 2008
By default Windows Server 2008 firewall blocks ping requests. To enable please follow the...
How to enable ping response on Windows Server 2012
By default Windows Server 2012 firewall blocks ping requests. To enable please follow the below...
How to fix CentOS 6 : YumRepo Error: All mirror URLs are not using ftp, http[s] or file.
Hi , Thank you for choosing Service from Host4Fun.Com. When we run command "yum update" on our...
How to fix CentOS 6 error
For Guide Visit :...