Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Due to an intermittent internet connecton and some fat fingered typing, I came very close to sending the command chown -R / to my server, which I think would be fairly disruptive.

Is there a way to backup just the permissions on all the files on the system?

share|improve this question
up vote 16 down vote accepted

To back up all permissions on the system:

getfacl -R / > acl_backup

To restore:

setfacl --restore=acl_backup

Of course, check out the manpages but it's a pretty straight forward command that many people are unaware of:

man getfacl
man setfacl
share|improve this answer
Nice - backup of acl is 18Mb on my system. Hope I never need to restore it. Thanks! – dunxd Oct 25 '10 at 7:36
Glad it worked! :-) – Belmin Fernandez Oct 25 '10 at 13:50

You can run ls -lR / > permissions_backup to create a file containing all permissions, but this would be quite hard to restore. You could of course quickly write a script to do it.

share|improve this answer

There's no specific command to back up file permissions. As the previous poster mentions, you could craft a recursive find or ls -lR to a file, and then compare that file with the permissions on any particular file you're interested in.

Alternatively, there are packages for intrusion detection which monitor file sizes and permissions that this is probably overkill for your scenario.


share|improve this answer

If you use a Linux distribution what uses packages (basically anything except Slackware), the permissions are probably stored in the RPM/Deb/whatever database. For RPMs, check out the --setperms and --setugids options.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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