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:
- login in Recover Mode
- restart
- press and hold “Shift”
- from GRUB, select Advanced settings
- select latest kernel with (recovery mode) post-fixed
- select “root”
- since filesystem is in read-only mode, we need to remount it in read-write:
sudo mount -o remount,rw / - Now we can return ownership back to root by:
sudo chown root:root / - to make sure we’re good,
ls -lah, everything should haveroot - enter
rebootand we’re good to go