I was installing LAMP and I accidentally "chmoded" with -R my hole home user folder.... (sudo chmod 755 /home/user -R) but now my desktop themes won't load... I'm Using the Mate version of Debian Jessie... How to get things back to normal? or what's the normal chmod config for my hole home user folder?

Can anyone help out?

  • Does the X server start? – Fiximan Mar 9 '16 at 21:02

I don't believe there's a simple way to undo what you have done. The standard response is to recover everything from your last backup - but not everyone has backups.

The only other option I am aware of is to fix the permissions manually. That means you need to know what the original permissions were.

You could create a new user, switch to that user, set up the software and themes you want to use, and then compare the permissions on the files in the new user directory with the permissions of the files in the old one, and fix the old one.

  • If I reformat my pc and mount that home partition again without erasing off course the files will still have their permissions? – João Geraldo Neto Mar 9 '16 at 18:07
  • I'm not sure I really understand that - but you've changed the permissions of the files in the filesystem, on the disk. Those changes are permanent. You can modify them again, but you can't undo them without reverting to a backup. – EightBitTony Mar 9 '16 at 18:08
  • Can you or anyone else check their .theme folder and files permissions for me? aparently thats the only thing is not working – João Geraldo Neto Mar 9 '16 at 18:19
  • You may have broken other things, you just haven't found them yet - if you have a .ssh directory, then the permissions you've set are now leaving the content at risk, for example. – EightBitTony Mar 9 '16 at 18:20
  • 1
    @EightBitTony the contents of the .ssh directory are ignored if they have the wrong permissions. In particular the authorized keys are. – Centimane Mar 9 '16 at 18:29

There's no miracle recipe to restore permissions, other than restoring from a backup. But fortunately for you permissions in a typical home directory are typically not very diverse.

  • Most regular files should have permission rw-r--r-- (644) if you don't mind that other users can read them, or rw------- (600) if they're private.
  • Directories should have permission rwxr-xr-x (755) if you don't mind that other users can access files in them, or rwx------ (700) if you want all the files in them to be private.
  • If you need to work with other users on the same machine, you might need to give them access via groups or ACL, but you'd know about that.
  • The .ssh directory needs to be more restrictive. The simple thing is to make it fully private.
  • Files that you want to execute need to be made executable. These are far in between unless you have software installed in your home directory.

Starting from everything in mode 755, this should mostly fix things:

find ~ -type d -exec chmod 755 {} + -type f -exec chmod -x {} +
chmod +x ~/bin/*
chmod go= ~/.ssh ~/.ssh/*
  • depending on the distro, 660 or 640 may be more appropriate for private files than 600 . e.g. debian creates each user with their own group (with the same groupname as the username). similarly, 770 or 750 for directories rather than 700. (obviously, excluding things like ~/.ssh because ssh is rightfully very strict about directory and file permissions for its config files). – cas Mar 11 '16 at 2:11

Ok Found a solution here... Copy All Files to a NTFS partition... Format or Create another User and Copy back the files you need to the new system or the new user account... Done...

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.