{"id":626,"date":"2019-04-14T17:09:35","date_gmt":"2019-04-14T09:09:35","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=626"},"modified":"2022-05-27T16:55:03","modified_gmt":"2022-05-27T08:55:03","slug":"chattr","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/chattr","title":{"rendered":"chattr\u547d\u4ee4 – \u66f4\u6539\u6587\u4ef6\u9690\u85cf\u5c5e\u6027"},"content":{"rendered":"\n
chattr\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cchange attribute\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u66f4\u6539\u6587\u4ef6\u9690\u85cf\u5c5e\u6027\u3002\u5e38\u7528\u7684ls\u547d\u4ee4\u4ec5\u80fd\u591f\u67e5\u770b\u5230\u6587\u4ef6\u7684\u4e00\u822c\u6743\u9650\u3001\u7279\u6b8a\u6743\u9650\u3001SELinux\u5b89\u5168\u4e0a\u4e0b\u6587\u4e0e\u662f\u5426\u6709FACL\u8bbf\u95ee\u63a7\u5236\u5217\u8868\u7b49\u60c5\u51b5\uff0c\u4f46\u5374\u65e0\u6cd5\u67e5\u770b\u5230\u6587\u4ef6\u9690\u85cf\u5c5e\u6027\uff0c\u6240\u4ee5\u6709\u4e9b\u8fd0\u7ef4\u4eba\u5458\u751a\u81f3\u4e0d\u6e05\u695a\u7adf\u7136\u8fd8\u6709\u7b2c\u4e94\u79cd\u6587\u4ef6\u6743\u9650\uff01~<\/p>\n\n\n\n
\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>chattr \u53c2\u6570 \u6587\u4ef6<\/p>\n\n\n\n \u5b9e\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n \u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n \u7ed9\u6307\u5b9a\u6587\u4ef6\u6dfb\u52a0\u9690\u85cf\u5c5e\u6027\uff1a<\/p>\n\n\n\n \u4ece\u6307\u5b9a\u6587\u4ef6\u79fb\u9664\u9690\u85cf\u5c5e\u6027\uff1a<\/p>\n\n\n\n \u7ed9\u6307\u5b9a\u76ee\u5f55\u6dfb\u52a0\u9690\u85cf\u5c5e\u6027\uff0c\u9012\u5f52\u64cd\u4f5c\uff1a<\/p>\n\n\n\n \u4ece\u6307\u5b9a\u76ee\u5f55\u79fb\u9664\u9690\u85cf\u5c5e\u6027\uff0c\u9012\u5f52\u64cd\u4f5c\uff1a<\/p>\n\n\n\n chattr\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cchange attribute\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u66f4\u6539\u6587\u4ef6\u9690\u85cf\u5c5e\u6027\u3002\u5e38\u7528\u7684 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[1],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/626"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=626"}],"version-history":[{"count":18,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/626\/revisions"}],"predecessor-version":[{"id":10136,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/626\/revisions\/10136"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=626"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=626"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=626"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}-R <\/td> \u9012\u5f52\u5904\u7406\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6<\/td><\/tr> -v <\/td> \u8bbe\u7f6e\u6587\u4ef6\u6216\u76ee\u5f55\u7248\u672c <\/td><\/tr> -V <\/td> \u663e\u793a\u6307\u4ee4\u6267\u884c\u8fc7\u7a0b <\/td><\/tr> +<\/td> \u5f00\u542f\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u8be5\u9879\u5c5e\u6027 <\/td><\/tr> --<\/td> \u5173\u95ed\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u8be5\u9879\u5c5e\u6027 <\/td><\/tr> =<\/td> \u6307\u5b9a\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u8be5\u9879\u5c5e\u6027 <\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n \u6743\u9650<\/td> \u4f5c\u7528<\/td><\/tr> i<\/td> \u65e0\u6cd5\u5bf9\u6587\u4ef6\u8fdb\u884c\u4fee\u6539\uff1b\u82e5\u5bf9\u76ee\u5f55\u8bbe\u7f6e\u4e86\u8be5\u53c2\u6570\uff0c\u5219\u4ec5\u80fd\u4fee\u6539\u5176\u4e2d\u7684\u5b50\u6587\u4ef6\u5185\u5bb9\u800c\u4e0d\u80fd\u65b0\u5efa\u6216\u5220\u9664\u6587\u4ef6<\/td><\/tr> a<\/td> \u4ec5\u5141\u8bb8\u8865\u5145\uff08\u8ffd\u52a0\uff09\u5185\u5bb9\uff0c\u65e0\u6cd5\u8986\u76d6\/\u5220\u9664\u5185\u5bb9\uff08Append Only\uff09<\/td><\/tr> S<\/td> \u6587\u4ef6\u5185\u5bb9\u5728\u53d8\u66f4\u540e\u7acb\u5373\u540c\u6b65\u5230\u786c\u76d8\uff08sync\uff09<\/td><\/tr> s<\/td> \u5f7b\u5e95\u4ece\u786c\u76d8\u4e2d\u5220\u9664\uff0c\u4e0d\u53ef\u6062\u590d\uff08\u75280\u586b\u5145\u539f\u6587\u4ef6\u6240\u5728\u786c\u76d8\u533a\u57df\uff09<\/td><\/tr> A<\/td> \u4e0d\u518d\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6700\u540e\u8bbf\u95ee\u65f6\u95f4\uff08atime\uff09<\/td><\/tr> b<\/td> \u4e0d\u518d\u4fee\u6539\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u5b58\u53d6\u65f6\u95f4<\/td><\/tr> D<\/td> \u68c0\u67e5\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u9519\u8bef<\/td><\/tr> d<\/td> \u4f7f\u7528dump\u547d\u4ee4\u5907\u4efd\u65f6\u5ffd\u7565\u672c\u6587\u4ef6\/\u76ee\u5f55<\/td><\/tr> c<\/td> \u9ed8\u8ba4\u5c06\u6587\u4ef6\u6216\u76ee\u5f55\u8fdb\u884c\u538b\u7f29<\/td><\/tr> u<\/td> \u5f53\u5220\u9664\u8be5\u6587\u4ef6\u540e\u4f9d\u7136\u4fdd\u7559\u5176\u5728\u786c\u76d8\u4e2d\u7684\u6570\u636e\uff0c\u65b9\u4fbf\u65e5\u540e\u6062\u590d<\/td><\/tr> t<\/td> \u8ba9\u6587\u4ef6\u7cfb\u7edf\u652f\u6301\u5c3e\u90e8\u5408\u5e76\uff08tail-merging\uff09<\/td><\/tr> x<\/td> \u53ef\u4ee5\u76f4\u63a5\u8bbf\u95ee\u538b\u7f29\u6587\u4ef6\u4e2d\u7684\u5185\u5bb9<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n [root@linuxcool ~]# chattr +i anaconda-ks.cfg<\/strong><\/pre>\n\n\n\n
[root@linuxcool ~]# chattr -i anaconda-ks.cfg\u00a0\u00a0 <\/strong><\/pre>\n\n\n\n
[root@linuxcool ~]# chattr -R +i \/root<\/strong><\/pre>\n\n\n\n
[root@linuxcool ~]# chattr -R -i \/root<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"