I have not used ubuntu before and installed it on an old pc. Due to a few personal problems it has remained unused for several months. I returned to it today and do not remember the sign-in password. (as the owner) I can use it as a guest, but it says it will not save data. I ask (stupid question) how can I sign-in as the administrator/owner and change my old unknown password, to a new one that I can remember, please? Thank you for your help. jt
2 Answers
Turn on your device, then hold down the "shift" key. You will be greeted by the "grub" menu. Then select the second option on the screen:
Now, you will see a menu with these options:
Select the "root" option.
Then you will be greeted by a root prompt that looks like this:
root@ubuntu:~#
Now type:
mount -rw -o remount /
Then type: root@ubuntu:~# passwd username
Then it will prompt you top type in a new password for your account:
Enter new UNIX password: Retype new UNIX password:
You should see a message like this after you change your password:
passwd: password updated successfully
Reboot, and you should be able to login with your new password!
Enjoy!
Boot your computer, and at the grub menu, select "Advanced options", then at the next screen, select the top option with "(recovery mode)" next to it.
At the recovery menu, select "root".
Change your file system to read-write by typing mount -rw -o remount /
If you forgot your username, type in cd /home
and then ls
. This will list the contents of the /home folder. You will see folders for your user(s) which will match the username.
If for example you have a folder called "john", you would then type this:
passwd john
Then you will be asked twice to enter a new password.
Type reboot
to restart your computer and login normally using the new password you just set.
The last step is to either remember your password or bookmark this page ;)