I messed up chmod (set all to 644 by a stupid accident) and now I am locked out of the admin account. I tried this and created an emergency account successfully but when I try to log in I am stuck in a log in loop.

Is there any way to fix this or do I have to apt-get install --reinstall ubuntu-desktop? I am using a VMware remote console to access the computer.

  • 1
    I'm pretty sure you need root privilege (through either sudo or by root login) to use apt-get that way.
    – Zeiss Ikon
    Oct 17, 2016 at 13:40
  • I have access to the shell through recovery mode. Will that work?
    – Pawel
    Oct 17, 2016 at 13:42
  • yes you can fix it in recovery, but what exactly did you chmod? if it was EVERYTHING (using -R flag) you have a long battle ahead - might be easier to get your personal files backed up and reinstall
    – Zanna
    Oct 17, 2016 at 13:43
  • I ran sudo chmod 664 / thinking it would only chmod the files in the current folder. How stupid. Will reinstalling ubuntu-desktop through the shell reinstall everything with correct permissions etc? I don't have much on that system, mainly just apache but all files are backed up on git.
    – Pawel
    Oct 17, 2016 at 13:46

1 Answer 1


Phew, I managed to fix it. I realised that I had only changed the permissions of the / folder, not recursively. What I did is I went into the recovery mode and into the root shell. Then ran mount -o remount,rw / and sudo chmod 755 /.

That'll teach me a lesson to be much more careful with chmod.

Thanks @Zanna for the help.

  • glad you fixed it, +1 for working it out yourself
    – Zanna
    Oct 18, 2016 at 8:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.