Friday, January 25, 2019

permissions - Lost my user, cannot login anymore


This is a summary of what happened:



  • Installed Ubuntu 16.04. Working fine for months.

  • Changed my user password.

  • After logging out, I cannot login anymore, neither with the old nor with the new password.

  • My home directory is still there (so I backed it up).

  • I boot from DVD in EUFI mode and login from there.

  • With: sudo passwd $username I get the error: user does not exist.

  • Recreated my user in the sudo group: sudo adduser $username

  • Now the user directory is empty, instead of being the original one. It seems to be located in a ramdisk (?)


How can I fix this problem? How can I restore the system, recreate/restore my user in the hard disk located /home?



The DVD Live session does not load your hard drive by default. The whole session is different from the session you have when you boot normally to your hard drive.


You can change your password by booting into your normal session in Rescue Mode


Perform these steps:


Reboot your computer. At the grub prompt select Advance Options for Ubuntu and press ENTER. Go into Recovery Mode. (You may have to hit esc to disable the ping screen.) Continue with:



  1. Drop to root shell prompt

  2. ENTER for maintenance.

  3. Remount the root system with:


# sudo mount -o remount,rw /
# passwd "username"
# exit


  1. Resume


You should now be at the normal login with the new password in effect.


No comments:

Post a Comment

11.10 - Can't boot from USB after installing Ubuntu

I bought a Samsung series 5 notebook and a very strange thing happened: I installed Ubuntu 11.10 from a usb pen drive but when I restarted (...