To reset password for ubuntu server or desktop where recovery mode is asks for password you need to have a physical access to the machine.
You want to take the cd out and make sure you're actually run from the machine not from live cd again.
Hope this help somebody, as helped me.
Source : Ask Ubuntu.
Prepare ubuntu live cd
Get live cd with version same on the machine. Run from live cd and wait until live cd fully loaded. Choose 'Try Ubuntu' and wait until desktop ubuntu loaded.
Open Terminal
And then open new terminal with command ctrl + alt + t. and check with command lsblk.
in this case, we know that our macine is in /dev/sda2. if there is volume group whre machine installed, it will show also.$ lsblk NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINT sda 8:0 0 119,2G 0 disk ├─sda1 8:2 0 16G 0 part [SWAP] └─sda2 8:3 0 103,2G 0 part / sr0 11:0 1 1024M 0 rom /cdrom
Mount the partision and chroot into it
We already know the partition where ubuntu installed, we mount it with command.
next we chroot to that mounted pastition with command.sudo mount /dev/sda2 /mnt
sudo chroot /mntif nothing wrong we will see now the prompt on terminal like root@ubuntu:/#. We already in root mode in our forget password machine.
Change the Password
We can change the password then with command.
set your new password for user root.passwd root
Exit chroot and Reboot
Exit from chroot with ctrl + d or you can type exit.
Unmount the machine with sudo umount /mnt and then reboot by sudo reboot. You want to take the cd out and make sure you're actually run from the machine not from live cd again.
Hope this help somebody, as helped me.
Source : Ask Ubuntu.
Comments
Post a Comment