?????????????????????????????飺??????????????С??????”chmod -R 777 /”??????????????磬?????????????????????????????????У?????????????????????????????????cp??rsync??etckeeper?????????????????????????????????????????????????????
???????????????????????????(?????????????)?????磺???????Щ????????????????????????????????д?????????????????????????????????????????????chmod?????????????Щ????£????????????????????????????б?????????????????????????????????????????£??????????????????????????????????????????????????
??????Linux??????????????????????÷???????б?(ACL)????????ACL???????????????????????posix??????????????????????????
?????????????????ACL??????????Linux????????
????1. ???ACL????
??????Debian?? Ubuntu??Linux Mint??
????$ sudo apt-get install acl
??????CentOS??Fedora??RHEL??
????$ sudo yum install acl
????2. ?????????£???????????????????????
????[root@linuxprobe tmp]#  ls -l
????total 8
????-rwxr--r--. 1 root root  0 Mar  3 04:40 install.txt
????-rwxr-xr-x. 1 root root  0 Mar  3 04:41 linuxprobe.txt
????[root@linuxprobe tmp]# getfacl -R . > permissions.txt
????...
???????????????????ACL??????д?????permissions.txt?????
???????????????permissions.txt????в????????
????[root@linuxprobe tmp]# cat permissions.txt
????# file: .
????# owner: root
????# group: root
????# flags: --t
????user::rwx
????group::rwx
????other::rwx
????# file: install.txt
????# owner: root
????# group: root
????user::rwx
????group::r--
????other::r--
????# file: linuxprobe.txt
????# owner: root
????# group: root
????user::rwx
????group::r-x
????other::r-x
????# file: permissions.txt
????# owner: root
????# group: root
????user::rw-
????group::r--
????other::r--
????...
????3. ?????????????磺???linuxprobe.txt??install.txt???
????[root@linuxprobe tmp]# chmod 733 linuxprobe.txt
????[root@linuxprobe tmp]# chmod 573 install.txt
????[root@linuxprobe tmp]# ls -l
????total 8
????-r-xrwx-wx. 1 root root    0 Mar  3 04:40 install.txt
????-rwx-wx-wx. 1 root root    0 Mar  3 04:41 linuxprobe.txt
????-rw-r--r--. 1 root root 4361 Mar  3 04:41 permissions.txt
????......
????4. ?????????
????1??cd??????permissions.txt????????
????2?????????????
????setfacl --restore=permissions.txt
???????????linuxprobe.txt??install.txt???????
????[root@linuxprobe tmp]# setfacl --restore=permissions.txt
????[root@linuxprobe tmp]# ls -l
????total 8
????-rwxr--r--. 1 root root    0 Mar  3 04:40 install.txt
????-rwxr-xr-x. 1 root root    0 Mar  3 04:41 linuxprobe.txt
????-rw-r--r--. 1 root root 4361 Mar  3 04:41 permissions.txt
????......