In my work one day after the execution of Chmod-r 777/home I regret very much, this do not know what to do? The heart is very anxious. At this time brainwave asked Google, finally found a way to solve this problem, but the premise is to do their own file rights backup work, and now I will explain to you the process I deal with:
1. Today I will use the/home/tong directory to do experiments to see the/home/tong directory and file existing permissions
[Email protected] home]# ll/home/tong/
Total 0
-rw-r--r--. 1 root root 0 Dec 4 09:45 1.txt
-rw-r--r--. 1 root root 0 Dec 4 09:45 2.txt
2. Back up the file permissions in the directory with the/home/tong directory (be careful not to make this command in the directory you want to back up, preferably at the top level of the directory, write the relative path)
[Email protected] ~]# cd/home/
[email protected] home]# getfacl-r tong/> 11.bak --Backup and save file permissions to a file
Getfacl:removing leading '/' from absolute path names
[Email protected] home]#
3. Modify directory permissions and see if permissions are modified
[email protected] home]# chmod-r 777 tong/ --Modify directory and file permissions
[[email protected] home]# ll/home/tong/ --View file permissions
Total 0
-rwxrwxrwx. 1 root root 0 Dec 4 09:45 1.txt
-rwxrwxrwx. 1 root root 0 Dec 4 09:45 2.txt
[Email protected] home]#
4. Restore directory and File permissions
[email protected] home]# Setfacl--restore=11.bak --Restore directory and file permissions
[email protected] home]# ll tong/ --Success, and wish you all success
Total 0
-rw-r--r--. 1 root root 0 Dec 4 10:16 1.txt
-rw-r--r--. 1 root root 0 Dec 4 10:16 2.txt
[Email protected] home]#
Transferred from: http://www.centoscn.com/CentOS/config/2014/0120/2387.html
Recovery of directory permissions after modifying the CentOS system