Changing ownership of filesystem in Ubuntu recovery / root mode

I was messing around with permissions and ownership in Ubuntu without knowing much of the consequences, one thing that leaded to not being able to login with my username/password (login screen loop as some may call) was when I changed ownership of the root “/” to the logged in user “mahmoud”.

To fix that:

  1. login in Recover Mode
    1. restart
    2. press and hold “Shift”
    3. from GRUB, select Advanced settings
    4. select latest kernel with (recovery mode) post-fixed
    5. select “root”
  2. since filesystem is in read-only mode, we need to remount it in read-write:
    sudo mount -o remount,rw /
  3. Now we can return ownership back to root by:
    sudo chown root:root /
  4. to make sure we’re good, ls -lah, everything should have root
  5. enter reboot and we’re good to go

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s