LINUX file or directory permissions batch modification skills

  
                  

Enlightenment:

After a user in CU uses "#chown -R 777 /*", the system is paralyzed.

Some netizens suggest using the following command to put another new one. The permissions of all files and directories of the same system are imported into the system.

is actually the application of these two commands.

Target: use of setfacl getfacl two commands.

:

1.

#pwd Confirm current directory

/

#getfacl -R /root > 11.bak Get all under /root Permission table file for files and directories.

#chmod -R 700 /root/* Change the permissions of all files or directories under /root to 700

#cd /root Switch directories#br >

#ll View Confirmation

#cd /

#setfacl --restore=11.bak Restore permissions for all files and directories under /root

Copyright © Windows knowledge All Rights Reserved