Backing up permissions on Linux

Solution 1:

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

Solution 2:

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.