5. \u914d\u7f6e sudo \u7684\u90e8\u5206\u6743\u9650<\/strong><\/span><\/div>\n\r\n[root@localhost ~]# cd \/tmp\r\n[root@localhost tmp]# rm -rf *\r\n[root@localhost tmp]# ll\r\ntotal 0\r\n[root@localhost tmp]# touch file\r\n[root@localhost tmp]# mkdir dir\r\n[root@localhost tmp]# ll\r\ntotal 0\r\ndrwxr-xr-x. 2 root root 6 Jul 18 03:01 dir\r\n-rw-r--r--. 1 root root 0 Jul 18 03:01 file\r\n[root@localhost tmp]# whereis cat\r\ncat: \/usr\/bin\/cat \/usr\/share\/man\/man1\/cat.1.gz\r\n[root@localhost tmp]# visudo\r\n# \u628a \/etc\/sudoers \u914d\u7f6e\u6587\u4ef6\u4e2d\u7684 test ALL=(ALL) ALL \u6539\u4e3a test ALL=(ALL) \/usr\/bin\/cat\r\n[root@localhost ~]# cat \/etc\/sudoers | grep cat\r\n## Updating the locate database\r\n# Defaults specification\r\n# Preserving HOME has security implications since many programs\r\ntest ALL=(ALL) \/usr\/bin\/cat\r\n[root@localhost ~]# su - test\r\nLast login: Thu Jul 18 03:06:55 EDT 2019 on pts\/0\r\n[test@localhost ~]$ sudo cat \/etc\/shadow\r\n# \u7ed9 test \u7528\u6237\u914d\u7f6e\u4e86\u67e5\u770b\u6743\u9650\r\nroot:$6$YZrm6scxO5zzICbR$fOzORb.0Ib9POZzJmrnzOGDqfFySp8X.9p5QpcpnJXWHIJvZcFpXQONyNigwrZbhXtyfnFn5F1mJsdkXS3jEF\/::0:99999:7:::\r\nbin:*:16925:0:99999:7:::\r\ndaemon:*:16925:0:99999:7:::\r\nadm:*:16925:0:99999:7:::\r\n***\u7701\u7565\u90e8\u5206\u8f93\u51fa\u4fe1\u606f***\r\n[test@localhost ~]$ cd \/tmp\r\n[test@localhost tmp]$ ll\r\ntotal 0\r\ndrwxr-xr-x. 2 root root 6 Jul 18 03:06 dir\r\n-rw-r--r--. 1 root root 0 Jul 18 03:01 file\r\n[test@localhost tmp]$ rm -rf dir\r\n# test \u7528\u6237\u5df2\u7ecf\u6ca1\u6709\u4e86\u5220\u9664\u6743\u9650\r\nrm: cannot remove \u2018dir\u2019: Permission denied\r\n[test@localhost tmp]$ rm -rf file \r\n# test \u7528\u6237\u5df2\u7ecf\u6ca1\u6709\u4e86\u5220\u9664\u6743\u9650\r\nrm: cannot remove \u2018file\u2019: Permission denied\r\n[test@localhost tmp]$ ll\r\ntotal 0\r\ndrwxr-xr-x. 2 root root 6 Jul 18 03:06 dir\r\n-rw-r--r--. 1 root root 0 Jul 18 03:01 file\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"\u9650\u5236\u7528\u6237\u6267\u884c\u6307\u5b9a\u7684\u547d\u4ee4 \u8bb0\u5f55\u7528\u6237\u6267\u884c\u7684\u6bcf\u4e00\u6761\u547d\u4ee4 \u914d\u7f6e\u6587\u4ef6\uff08\/etc\/sudoers\uff09\u63d0\u4f9b\u96c6\u4e2d\u7684\u7528\u6237\u7ba1\u7406\u3001\u6743\u9650 […]<\/p>\n","protected":false},"author":63,"featured_media":151444,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[55],"tags":[],"class_list":["post-151443","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-thread"],"acf":[],"_links":{"self":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/151443","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\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/comments?post=151443"}],"version-history":[{"count":5,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/151443\/revisions"}],"predecessor-version":[{"id":151653,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/151443\/revisions\/151653"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/151444"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=151443"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=151443"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=151443"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}