0

I broke my home directory and file permissions by moving to and from drives etc. How do I restore default permissions on my home directory?

1

You could run as root these commands, where user is the user's name:

sudo chown -R user /home/user

And if necessary:

find /home/user -type f -exec chmod 0664 {} \;
find /home/user -type d -exec chmod 0775 {} \;

The later will destroy permissions such as execute, which you will need to add manually as required. Presumably, these permissions were already lost after being copied to external filesystems that didn't support them.

| improve this answer | |
  • running the chmods above might not work as you run the first command with sudo and if the files are not owned or accessible by user "user" if we suppose the use "user" is logged in. and no only it will not restore execute access, it will even destroy it - it will REMOVE the execute bit from all files. and we don't know what is broken. so maybe a plain sudo chown -R user /home/user will fix the OP's issue. – Zina Nov 9 '18 at 22:36
  • @Zina: Right - I modified my answer. – harrymc Nov 10 '18 at 7:52

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.