I have changed permission of the main folder and cannot login anymore

by telcom   Last Updated July 03, 2019 04:02 AM

I have changed the permission of The root folder, where /tmp and /usr are to:

sudo chown - R root *

Now I cannot login, only black screen is showing and everything is a mess. Is there anyway to reverse it to normal. Should I do a fresh install?

Answers 1

You have accidentaly changed the owner of every folder to be root , thus you are unable to login anymore.

Most probably you havent set the root password , if you have just skip this section:

Part 1

  • Start the grub menu during the boot by holding Shift/Esc
  • Choose the Option which has (recovery) at the end of it.
  • There will be another menu , from which you have to choose Drop to root shell promt
  • Then you will see something like [email protected]:~#
  • Use this command mount -rw -o remount / to get rid of the read only thing
  • Now do a passwd , which will prompt you the enter a new password for the root
  • Thats done then reboot

Here you have successfully set up a new root password , if you are having problems then refer to this question.

Part 2 Here you are going to change the permissions for your home directory.

  • Boot up to the login screen.
  • Press Ctrl + Alt + F1
  • At login type root and enter the password you have set for it in the last part
  • Now its time for changing the file permissions for your home folder.For that you have to do a chown -R root:username /home/username chown -R <username>:<username> /home/<username>. Change the username to your username.

Hope it helps , thank you.

August 09, 2016 05:03 AM

Related Questions

Why is root user denied access to a file?

Updated May 20, 2019 17:02 PM

Fix setuid and setgid bits in /usr?

Updated December 08, 2018 15:02 PM

Owner of /usr/lib is not root

Updated July 14, 2016 08:00 AM