So recently I accidentally started changing all the permissions in root to my unprivileged account :(. It happened because I was switching between users and shells and the directory changed to / without me noticing. Luckily I had -c enabled so I realised there was something wrong quite quickly(just after the home dir). I then ran chown root:root -R (all files owned by me in /) Now I'm having problems with xscreensaver and su'ing reurns failed auth. I can still use sudo though. Is there any maybe a list of permissions somewhere? I'm running the latest Mint XFCE.

  • 1
    And you are running Mint or Ubuntu?
    – user103789
    Nov 24 '15 at 20:46
  • @ParanoidPanda Mint. I updated the question Nov 24 '15 at 21:56
  • Well , since you recursively chowned everything, you also have chowned everything in your home . . . .Do chown -R yourUsername:yourUsername /home/yourUsername to get your stuff back to your ownership Nov 24 '15 at 22:07
  • @Serg The problem is that most of the root filesystem was owned by me instead of root. I was attempting to do chown -R yourUsername:yourUsername ./ but I was in / not ~ Nov 24 '15 at 22:14
  • Oh, I see. Changing ownership of everything on the filesystem back to root user will be the easiest next to reinstalling. But there are many direcotries in files , such as /etc/shadow or /etc/mtab.fuselock that have different group ownership, so if you chown everything to root recursivelly you still have to go back and fix many other files. Nov 24 '15 at 22:21

This is pretty much an "+++ Out of Cheese Error. Redo From Start. +++" situation.

Lots of files down in the guts run as different users/groups and while most things can live as "root:root" if this is going to be a long running system you're better off backing up /home and repaving.

Alternatively find another computer, install virtual box, install mint, and then run:

find ./ | xargs ls -lth | awk ' { print $1"\t"$3":"$4" "$NF } ' > /var/tmp/perms.

You should then be able to copy perms over to your mint computer, and write a script that reads that file and sets the right user/group ownership.

Actually, that would be a good penance as well as a useful technical exercise. :)


I found the simplest method of fixing all the permissions. https://serverfault.com/a/117149/191095

getfacl -R / > /root/perms.acl
setfacl --restore=/root/perms.acl

It works perfectly. Now my xscreensaver and logging in as root work again :-)

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.