1

I can no longer log in to my system after running this command :

sudo chown -R &USER: $HOME

as ROOT because I couldn't access a certain file.

Now I can't log in again.

fedorqui
  • 10,069
  • Are you sure you didn't forget the Caps Lock? :-) – RichArt Dec 16 '16 at 11:20
  • Nope, it's not caps lock issue, if it was, it was shown me invalid credentials. – michaelprime_ Dec 16 '16 at 11:21
  • So, what error or message do you get and at what stage? – RichArt Dec 16 '16 at 11:22
  • Once I input my credentials, the system returns the login screen again. Do you know of the command I stated above? – michaelprime_ Dec 16 '16 at 11:25
  • 2
    You have made the non-existent user &USER the owner of your home directory. You just need to chown it back. Please either boot in recovery (enable networking and start a root shell) or with a live usb/Cd (mount your root partition and /home if it is on another partition) and run the command sudo chown -R username: /home/username where username is your username. If you don't know how to do these things, please take a look at questions such as this for guidance or comment and I or someone else will help you – Zanna Dec 16 '16 at 12:16
  • Thank you all for your help. @Zanna I'm forever grateful. Problem solved. – michaelprime_ Dec 16 '16 at 19:25
  • awesome :D maybe you could post an answer to your question below with all the steps you did to help others in future :) – Zanna Dec 16 '16 at 19:39

1 Answers1

3

Here's how I solved my problem following Zanna recommendation.

  1. I booted into Recovery mode by holding the Shift key when restarting. When the GRUB menu shows, I selected the option that started with Advanced Option which shows options like Ubuntu GNU/Linux, with Linux 3.8.0-26-generic (recovery mode). I chose the first option with recovery mode and then selected Enable networking.
  2. I chose root shell prompt after (1) and ran the command sudo chown -R username: /home/username where username is my username. After the process finished running, I exited the shell and restarted my system.

And Voila! I was able to log in again with no files affected, everything was intact. :)