{"id":281794,"date":"2023-09-01T20:02:46","date_gmt":"2023-09-01T12:02:46","guid":{"rendered":"https:\/\/lrxjmw.cn\/fzggwjhwjjky.html"},"modified":"2023-09-01T20:02:46","modified_gmt":"2023-09-01T12:02:46","slug":"fzggwjhwjjky","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/fzggwjhwjjky.html","title":{"rendered":"\u9632\u6b62\u66f4\u6539\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u53ef\u4ee5\u8bbe\u5b9a\u4e86\u7279\u5b9a\u7684\u63a7\u5236\u5c5e\u6027"},"content":{"rendered":"

\u4e3a\u4e86\u5bb9\u8bb8\u6dfb\u52a0\u6570\u636e\uff0c\u907f\u514d\u4fee\u6539\u6216\u5219\u5220\u6389\u7b49\uff0c\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u53ef\u4ee5\u8bbe\u5b9a\u4e86\u7279\u5b9a\u7684\u63a7\u5236\u5c5e\u6027\u3002\u6bd4\u5982\uff0c\u4f60\u53ef\u4ee5\u5728\u5173\u952e\u7684\u7cfb\u7edf<\/a>\u6587\u4ef6\u6216\u5219\u6587\u4ef6\u5939\u4e2d\u542f\u7528\u5c5e\u6027\uff0c\u4e4b\u540e\u6ca1\u6709\u4efb\u4f55\u7528\u6237linux\u8ffd\u52a0\u6587\u4ef6<\/strong>\uff0c\u5305\u62ecrootlinux\u4e32\u53e3\u9a71\u52a8\uff0c\u53ef\u4ee5\u5220\u6389\u6216\u5219\u66f4\u6539\u5b83\uff0c\u4f8b\u5982\u4e0d\u5bb9\u8bb8\u4f7f\u7528\u50cfdump\u8fd9\u6837\u7684\u547d\u4ee4<\/a>\u7b49\u5907\u4efd\u5de5\u5177\u53bb\u5907\u4efd\u4e00\u4e2a\u7279\u5b9a\u7684\u6587\u4ef6\u6216\u5219\u6587\u4ef6\u5939\uff0c\u7b49\u7b49\u3002\u8fd9\u79cd\u5c5e\u6027\u53ea\u53ef\u4ee5\u5728ext2\uff0cext3\u6216\u5219ext4\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u4e0a\u8bbe\u5b9a\u3002<\/p>\n

\u8ffd\u52a0\u6587\u4ef6\u662f\u4ec0\u4e48\u610f\u601d_linux\u8ffd\u52a0\u6587\u4ef6<\/p>\n

\u6709\u4e24\u4e2a\u547d\u4ee4lsattr\u548cchattr\u62ff\u6765\u7ba1\u7406\u5c5e\u6027\u3002\u4e0b\u8fb9\u662f\u5e38\u7528\u5c5e\u6027\u7684\u5217\u8868\u3002<\/p>\n

\u5c5e\u6027<\/p>\n

\u63cf\u8ff0<\/p>\n

a(append)<\/p>\n

\u51c6\u8bb8\u5728\u6587\u4ef6\u4e2d\u8fdb\u884c\u8ffd\u52a0\u64cd\u4f5c<\/p>\n

\u8fd9\u4e2a\u5c5e\u6027\u4e0d\u5bb9\u8bb8\u66f4\u65b0\u6587\u4ef6\u7684\u8bbf\u95ee\u65f6\u95f4<\/p>\n

linux\u8ffd\u52a0\u6587\u4ef6_\u8ffd\u52a0\u6587\u4ef6\u662f\u4ec0\u4e48\u610f\u601d<\/p>\n

c(compressed)<\/p>\n

\u542f\u7528\u8fd9\u4e2a\u5c5e\u6027\u65f6\uff0c\u6587\u4ef6\u5728c\u76d8\u4e0a\u4f1a\u624b\u52a8\u538b\u7f29<\/p>\n

d(dump)<\/p>\n

\u4e0d\u80fd\u4f7f\u7528dump\u547d\u4ee4\u5907\u4efd\u6587\u4ef6<\/p>\n

\u8bbe\u7f6e\u4e86\u6587\u4ef6\u5939\u7684D\u5c5e\u6027\u65f6linux\u547d\u4ee4chm\uff0c\u4fee\u6539\u4f1a\u5728\u540c\u6b65\u4fdd\u5b58\u5728c\u76d8\u4e0a<\/p>\n

e(extentformat)<\/p>\n

\u5b83\u8868\u660e\uff0c\u8be5\u6587\u4ef6\u4f7f\u7528c\u76d8\u4e0a\u7684\u5757\u7684\u6620\u5c04\u6269\u5145<\/p>\n

i(immutable)<\/p>\n

\u5728\u6587\u4ef6\u4e0a\u542f\u7528\u8fd9\u4e2a\u5c5e\u6027\u65f6\uff0c\u6211\u4eec\u4e0d\u80fd\u4fee\u6539\u3001\u91cd\u547d\u540d\u6216\u5219\u5220\u6389\u8fd9\u4e2a\u6587\u4ef6<\/p>\n

j(journaling)<\/p>\n

\u8bbe\u7f6e\u4e86\u8fd9\u4e2a\u5c5e\u6027\u65f6\uff0c\u6587\u4ef6\u7684\u6570\u636e\u9996\u5148\u4fdd\u5b58\u5728\u65e5\u5fd7\u4e2d\uff0c\u4e4b\u540e\u518d\u5199\u5165\u6587\u4ef6<\/p>\n

S(synchronous)<\/p>\n

\u8bbe\u7f6e\u4e86\u8fd9\u4e2a\u5c5e\u6027\u65f6linux\u8ffd\u52a0\u6587\u4ef6<\/strong>\uff0c\u53d8\u66f4\u6216\u4fee\u6539\u540c\u6b65\u4fdd\u5b58\u5230c\u76d8\u4e0a<\/p>\n

chattr\u5c5e\u6027\u4e2d\u53ef\u4ee5\u4f7f\u7528\u7684\u4e0d\u540c\u9009\u9879\uff1a<\/p>\n

\u8ffd\u52a0\u6587\u4ef6\u662f\u4ec0\u4e48\u610f\u601d_linux\u8ffd\u52a0\u6587\u4ef6<\/p>\n

\u5728chattr\u4e2d\u7528\u4e8e\u8bbe\u7f6e\u6216\u5219\u53d6\u6d88\u5c5e\u6027\u7684\u64cd\u4f5c\u7b26<\/p>\n

chattr\u548clsattr\u547d\u4ee4\u7684\u57fa\u672c\u53e5\u578b\uff1a<\/p>\n

\n

# chattr   \n# lsattr <\/a><\/pre>\n<\/p>\n

\u4f8b:1\u4f7f\u7528\u2018i\u2019\u5c5e\u6027\u4f7f\u6587\u4ef6\u4e0d\u53ef\u4fee\u6539<\/p>\n

\n

[root@linuxtechi ~]# chattr +i dummy_data\n[root@linuxtechi ~]# lsattr dummy_data\n----i----------- dummy_data<\/pre>\n<\/p>\n

\u5982\u4eca\u8bd5\u7740\u5220\u6389\u6216\u5219\u66f4\u6539\u6587\u4ef6<\/p>\n

\n

[root@linuxtechi ~]# rm -f dummy_data\nrm: cannot remove 'dummy_data': Operation not permitted\n[root@linuxtechi ~]# echo \"test\" >> dummy_data\n-bash: dummy_data: Permission denied<\/pre>\n<\/p>\n

\u8ffd\u52a0\u6587\u4ef6\u662f\u4ec0\u4e48\u610f\u601d_linux\u8ffd\u52a0\u6587\u4ef6<\/p>\n

\u4f8b:2\u79fb\u9664\u4e0d\u53ef\u4fee\u6539\u5c5e\u6027<\/p>\n

\n

[root@linuxtechi ~]# chattr -i dummy_data\n[root@linuxtechi ~]# lsattr dummy_data\n---------------- dummy_data<\/pre>\n<\/p>\n

\u4f8b:3\u5728\u6587\u4ef6\u4e2d\u53ea\u5bb9\u8bb8\u8ffd\u52a0\u64cd\u4f5c<\/p>\n

\n

[root@linuxtechi ~]# chattr +a dummy_data\n[root@linuxtechi ~]# lsattr dummy_data\n-----a---------- dummy_data<\/pre>\n<\/p>\n

\u5982\u4eca\u8bd5\u7740\u628afstab\u6587\u4ef6\u7684\u5185\u5bb9\u8ffd\u52a0\u5230dummy_data\u6587\u4ef6<\/p>\n

\n

[root@linuxtechi ~]# cat \/etc\/fstab >> dummy_data\n[root@linuxtechi ~]#<\/pre>\n<\/p>\n

\u4f8b:4\u4f7f\u7528-R\u9009\u9879\u548c\u2018+i\u2019\u5c5e\u6027\u4f7f\u6587\u4ef6\u5939\u548c\u5b83\u7684\u5b50\u6587\u4ef6\u5939\u6210\u4e3a\u5b89\u5168\u76ee\u5f55<\/p>\n

\u8ffd\u52a0\u6587\u4ef6\u662f\u4ec0\u4e48\u610f\u601d_linux\u8ffd\u52a0\u6587\u4ef6<\/p>\n

\u8ba9\u6211\u4eec\u6765\u65b0\u5efa\u4e00\u4e2asysadmin\u6587\u4ef6\u5939\u548c\u5b83\u7684\u5b50\u6587\u4ef6\u5939<\/p>\n

\n

[root@linuxtechi ~]# mkdir sysadmin\n[root@linuxtechi ~]# mkdir sysadmin\/admim_{1,2,3,4,5}\n[root@linuxtechi ~]# ls -l sysadmin\/\ntotal 0\ndrwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_1\ndrwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_2\ndrwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_3\ndrwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_4\ndrwxr-xr-x. 2 root root 6 Apr 19 09:50 admim_5<\/pre>\n<\/p>\n

\u5728sysadmin\u6587\u4ef6\u5939\u9012\u5f52\u8bbe\u7f6e\u4e0d\u53ef\u4fee\u6539\u5c5e\u6027<\/p>\n

\n

[root@linuxtechi ~]# chattr -R +i sysadmin\n[root@linuxtechi ~]# lsattr -R sysadmin\/\n----i----------- sysadmin\/admim_1\nsysadmin\/admim_1:\n----i----------- sysadmin\/admim_2\nsysadmin\/admim_2:\n----i----------- sysadmin\/admim_3\nsysadmin\/admim_3:\n----i----------- sysadmin\/admim_4\nsysadmin\/admim_4:\n----i----------- sysadmin\/admim_5\nsysadmin\/admim_5:\n[root@linuxtechi ~]#<\/pre>\n<\/p>\n

\u5982\u4eca\u8bd5\u7740\u7528rm\u547d\u4ee4\u5220\u6389\u6587\u4ef6\u5939<\/p>\n

\n

[root@linuxtechi ~]# rm -rf sysadmin\nrm: cannot remove \u2018sysadmin\/admim_1\u2019: Permission denied\nrm: cannot remove \u2018sysadmin\/admim_2\u2019: Permission denied\nrm: cannot remove \u2018sysadmin\/admim_3\u2019: Permission denied\nrm: cannot remove \u2018sysadmin\/admim_4\u2019: Permission denied\nrm: cannot remove \u2018sysadmin\/admim_5\u2019: Permission denied\n[root@linuxtechi ~]#<\/pre>\n<\/p>\n

\u4f7f\u7528\u4ee5\u4e0b\u547d\u4ee4\u9012\u5f52\u53d6\u6d88\u5c5e\u6027<\/p>\n

\n

[root@linuxtechi ~]# chattr -R -i sysadmin<\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"

\u4f8b\u5982\uff0c\u4f60\u53ef\u4ee5\u5728\u5173\u952e\u7684\u7cfb\u7edf\u6587\u4ef6\u6216\u8005\u6587\u4ef6\u5939\u4e2d\u542f\u7528\u5c5e\u6027\uff0c\u7136\u540e\u6ca1\u6709\u4efb\u4f55\u7528\u6237\uff0c\u5305\u62ecroot\uff0c\u53ef\u4ee5\u5220\u9664\u6216\u8005\u4fee\u6539\u5b83\uff0c\u6bd4\u5982\u4e0d\u5141\u8bb8\u4f7f\u7528\u50cfdump\u8fd9\u6837\u7684\u547d\u4ee4\u7b49\u5907\u4efd\u5de5\u5177\u53bb\u5907\u4efd\u4e00\u4e2a\u7279\u5b9a\u7684\u6587\u4ef6\u6216\u8005\u6587\u4ef6\u5939\uff0c\u7b49\u7b49\u3002\u8fd9\u4e9b\u5c5e\u6027\u53ea\u53ef\u4ee5\u5728ext2\uff0cext3\u6216\u8005ext4\u6587\u4ef6\u7cfb\u7edf\u4e2d\u7684\u6587\u4ef6\u548c\u6587\u4ef6\u5939\u4e0a\u8bbe\u5b9a\u3002\u73b0\u5728\u8bd5\u7740\u628afstab\u6587\u4ef6\u7684\u5185\u5bb9\u8ffd\u52a0\u5230dummy_data\u6587\u4ef6\u5728sysadmin\u6587\u4ef6\u5939\u9012\u5f52\u8bbe\u7f6e\u4e0d\u53ef\u66f4\u6539\u5c5e\u6027<\/p>\n","protected":false},"author":1,"featured_media":281795,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-281794","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tougao","tag-999"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/281794","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=281794"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/281794\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/281795"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=281794"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=281794"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=281794"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}