{"id":3049,"date":"2018-09-11T09:16:16","date_gmt":"2018-09-11T01:16:16","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=3049"},"modified":"2018-09-11T09:16:16","modified_gmt":"2018-09-11T01:16:16","slug":"linux%e6%9d%83%e9%99%90%e7%ae%a1%e7%90%86chmod-755chmod-xxx%e6%95%99%e7%a8%8b","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=3049","title":{"rendered":"Linux\u6743\u9650\u7ba1\u7406chmod 755(chmod xxx)\u6559\u7a0b"},"content":{"rendered":"<p>\n\t\u6ca1\u600e\u4e48\u64cd\u4f5c\u8fc7 Linux \u7684\u4eba\uff0c\u603b\u662f\u5f88\u597d\u5947\uff0c\u4e3a\u4ec0\u4e48\u4f60\u6267\u884c chmod 755 \u540e\uff0c\u8fd9\u4e2a\u6587\u4ef6\u6211\u5c31\u53ef\u4ee5\u64cd\u4f5c\u4e86\u5462\uff1fchmod xxx \u662f\u4ec0\u4e48\u610f\u601d\u5462\uff1f\u4e14\u542c\u672c\u6587\u6765\u7ed9\u4f60\u4e00\u4e00\u7684\u8bb2\u89e3\uff01\n<\/p>\n<p>\n\t\u5728\u5f00\u59cb\u4e4b\u524d\uff0c\u6211\u4eec\u5148\u6765\u770b\u4e00\u5f20\u56fe\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"Chmod \u6743\u9650\u7528\u6cd5\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/chmod.png\" style=\"width: 493px;height: 120px\" \/>\n<\/p>\n<p>\n\t\u6211\u4eec\u53ef\u4ee5\u770b\u5230\u6267\u884c ls -l \u547d\u4ee4\u540e\uff0c\u6bcf\u4e00\u884c\u7684\u524d\u9762\u90fd\u6709\u4e00\u4e2a&ldquo;-rwxrwxr-x&rdquo;\uff0c\u8fd9\u6bb5\u795e\u5947\u7684\u4ee3\u7801\u662f\u4ec0\u4e48\u610f\u601d\uff1f\u800c\u6267\u884c chmod 755 xttblog.sh \u540e\u4e3a\u4ec0\u4e48\u8fd9\u6bb5\u4ee3\u7801\u53c8\u53d8\u4e86\uff01\n<\/p>\n<p>\n\t\u8981\u8bf4\u660e\u8fd9\u4e24\u4e2a\u95ee\u9898\uff0c\u5c31\u5fc5\u987b\u8981\u4ece Linux \u7684\u6743\u9650\u8bf4\u8d77\u3002&ldquo;-rwxrwxr-x&rdquo;\u8fd910\u4e2a\u5b57\u7b26\uff0c\u524d\u9762\u7b2c\u4e00\u4e2a\u5b57\u7b26\u4ee3\u8868\u6587\u4ef6\u7c7b\u578b\u3002Linux\u4e0b\uff0c\u6587\u4ef6\u7c7b\u578b\u5206\u4e3a\u4e0b\u9762\u8fd9\u51e0\u79cd\uff1a\n<\/p>\n<ul>\n<li>\n\t\td\uff1a\u76ee\u5f55directory\n\t<\/li>\n<li>\n\t\tl\uff1a\u7b26\u53f7\u94fe\u63a5link\n\t<\/li>\n<li>\n\t\ts\uff1a\u5957\u63a5\u5b57socket\n\t<\/li>\n<li>\n\t\tc\uff1a\u5b57\u7b26\u8bbe\u5907char\n\t<\/li>\n<li>\n\t\tp\uff1a\u547d\u540d\u7ba1\u9053pipe\n\t<\/li>\n<li>\n\t\t-\uff1a\u5176\u4ed6\uff0c\u4e0d\u5c5e\u4e8e\u4ee5\u4e0a\u51e0\u7c7b\n\t<\/li>\n<\/ul>\n<p>\n\t\u8fd9\u91cc\u7684-\u4ee3\u8868\u7684\u5c31\u662f\u5176\u4ed6\u7c7b\u578b\u3002\u518d\u540e\u9762\u7684&ldquo;rwxrwxr-x&rdquo; 9 \u4e2a\u5b57\u7b26\u548c\u8bbf\u95ee\u65b9\u5f0f\u6709\u5173\u3002\u5176\u4e2d\u5b83\u4eec 3 \u4e2a\u5b57\u7b26\u7ec4\u5408\u6210\u4e00\u7ec4\u3002\u6bcf\u4e00\u7ec4\u4ee3\u8868\u4e00\u79cd\u4e0d\u540c\u7684\u6743\u9650\u3002\n<\/p>\n<p>\n\trwx \u8fd9\u4e09\u4e2a\u5b57\u7b26\u4ee3\u8868\u7684\u662f\u8bfb\u5199\u6267\u884c\u8bbf\u95ee\u65b9\u5f0f\uff1a\n<\/p>\n<ul>\n<li>\n\t\t\u8bfb(read)\uff1a\u663e\u793a\u5185\u5bb9\n\t<\/li>\n<li>\n\t\t\u5199(write)\uff1a\u7f16\u8f91\u5185\u5bb9\uff0c\u5220\u9664\u6587\u4ef6\n\t<\/li>\n<li>\n\t\t\u6267\u884c(execute)\uff1a\u6267\u884c\u6587\u4ef6\n\t<\/li>\n<\/ul>\n<p>\n\t\u522b\u53d6\u8fd9\u4e09\u4e2a\u5355\u8bcd\u7684\u9996\u5b57\u6bcd\uff0c\u5c31\u5f62\u6210\u4e86 rwx \u7684\u7b80\u5199\u5f62\u5f0f\u3002\u90a3\u4e3a\u4ec0\u4e48 3 \u4e2a\u4e00\u7ec4\uff0c3 \u4e2a\u4e00\u7ec4\uff0c\u5206\u4e3a3\u7ec4\u5462\uff1f\n<\/p>\n<p>\n\t\u7b54\u6848\u662f\u9488\u5bf9\u7528\u6237\u8bbf\u95ee Linux \u6587\u4ef6\u6709\u4e09\u7c7b\u6743\u9650\uff1a\n<\/p>\n<ul>\n<li>\n\t\t\u521b\u5efa\u4eba(user)\u6743\u9650\uff1a\u521b\u5efa\u6587\u4ef6\u7684\u4eba\n\t<\/li>\n<li>\n\t\t\u7ec4(group)\u7528\u6237\u6743\u9650\uff1a\u548c\u62e5\u6709\u8005\u5904\u4e8e\u540c\u4e00\u7528\u6237\u7ec4\u7684\u5176\u4ed6\u4eba\n\t<\/li>\n<li>\n\t\t\u5176\u4ed6(other)\u7528\u6237\u6743\u9650\n\t<\/li>\n<\/ul>\n<p>\n\t\u524d\u9762\u7684 9 \u4e2a\u5b57\u7b26\uff0c\u6bcf 3 \u4e2a\u4e00\u7ec4\uff0c\u5206\u522b\u4ee3\u8868\uff1a\u521b\u5efa\u4eba(user)\u6743\u9650\uff0c\u7ec4(group)\u7528\u6237\u6743\u9650\uff0c\u5176\u4ed6(other)\u7528\u6237\u6743\u9650\u3002\n<\/p>\n<p>\n\t\u603b\u7ed3\u4e00\u4e0b\uff0c\u8fd9\u5341\u4e2a\u5b57\u7b26\uff0c\u53ef\u5206\u4e3a\u56db\u4e2a\u90e8\u5206\uff1a\n<\/p>\n<ul>\n<li>\n\t\t\u7b2c1\u4e2a\u5b57\u7b26\u8868\u793a\u6587\u4ef6\u7684\u7c7b\u578b\uff1a[-]\u8868\u793a\u666e\u901a\u6587\u4ef6\n\t<\/li>\n<li>\n\t\t\u7b2c234\u5b57\u7b26\u8868\u793a\u521b\u5efa\u4eba\u7684\u6743\u9650\uff1a[rwx]\u8868\u793a\u53ef\u8bfb\uff0c\u53ef\u5199\uff0c\u53ef\u6267\u884c\n\t<\/li>\n<li>\n\t\t\u7b2c567\u5b57\u7b26\u8868\u793a\u7ec4\u7528\u6237\u6743\u9650\uff1a[rwx]\u8868\u793a\u53ef\u8bfb\uff0c\u53ef\u5199\uff0c\u53ef\u6267\u884c\n\t<\/li>\n<li>\n\t\t\u7b2c890\u5b57\u7b26\u8868\u793a\u5176\u4ed6\u7528\u6237\u6743\u9650\uff1a[r-x]\u8868\u793a\u53ef\u8bfb\uff0c\u53ef\u6267\u884c\n\t<\/li>\n<\/ul>\n<p>\n\tchmod \u547d\u4ee4\u7528\u4e8e\u6539\u53d8\u6587\u4ef6\u7684\u6743\u9650\uff0c\u5b83\u6709\u4e24\u79cd\u4f7f\u7528\u65b9\u6cd5\u3002\n<\/p>\n<p>\n\t\u7b2c\u4e00\u79cd\uff1achomod [who] [operator] [permission] filename\n<\/p>\n<p>\n\t[who]\n<\/p>\n<ul>\n<li>\n\t\tu\uff1a\u521b\u5efa\u4eba\n\t<\/li>\n<li>\n\t\tg\uff1a\u7ec4\u7528\u6237\n\t<\/li>\n<li>\n\t\to\uff1a\u5176\u4ed6\u7528\u6237\n\t<\/li>\n<li>\n\t\ta\uff1a\u6240\u6709\u7528\u6237(all)\n\t<\/li>\n<\/ul>\n<p>\n\t[operator]\n<\/p>\n<ul>\n<li>\n\t\t+\uff1a\u589e\u52a0\u6743\u9650\n\t<\/li>\n<li>\n\t\t-\uff1a\u53d6\u6d88\u6743\u9650\n\t<\/li>\n<li>\n\t\t=\uff1a\u8bbe\u5b9a\u6743\u9650\n\t<\/li>\n<\/ul>\n<p>\n\t[permission]\n<\/p>\n<ul>\n<li>\n\t\tr\uff1a\u8bfb\n\t<\/li>\n<li>\n\t\tw\uff1a\u5199\n\t<\/li>\n<li>\n\t\tx\uff1a\u6267\u884c\n\t<\/li>\n<\/ul>\n<p>\n\t\u5982\u4f55\u7ed9\u4e00\u4e2a\u6587\u672c\u6587\u4ef6xttblog.sh\u589e\u52a0\u53ef\u6267\u884c\u6743\u9650\uff1f\n<\/p>\n<pre class=\"brush:bash;\">\r\nchmod u+x xttblog.sh<\/pre>\n<p>\n\t\u5982\u4f55\u4e0d\u8ba9\u5176\u4ed6\u7528\u6237\u4fee\u6539xttblog.sh\uff1f\n<\/p>\n<pre class=\"brush:bash;\">\r\nchmod go-w xttblog.sh<\/pre>\n<h2>\n\t\u6570\u5b57\u6a21\u5f0f<br \/>\n<\/h2>\n<p>\n\t\u7b2c\u4e8c\u79cd\u65b9\u6cd5\uff1achmod [mode] filename\u3002\u5230\u73b0\u5728\u4e3a\u6b62\uff0c\u6211\u4eec\u4f7f\u7528\u4e86\u53eb\u505a&ldquo;\u7b26\u53f7&rdquo;\u7684\u6a21\u5f0f\u6765\u7528 chmod \u6307\u5b9a\u6743\u9650\u7684\u6539\u53d8\u3002\u7136\u800c\uff0c\u6307\u5b9a\u6743\u9650\u8fd8\u6709\u4e00\u79cd\u666e\u904d\u4f7f\u7528\u7684\u65b9\u6cd5 &mdash; \u4f7f\u7528\u6570\u5b57\u6765\u6807\u793a\u6743\u9650\u7684\u7528\u6cd5\u3002\u8fd9\u79cd\u7528\u6cd5\u53eb\u53eb\u505a\u6570\u5b57\u6743\u9650\u8bed\u6cd5\u7684\u8bed\u6cd5\uff0c\u6bcf\u4e00\u4f4d\u4ee3\u8868\u4e00\u4e2a\u6743\u9650\u4e09\u5143\u7ec4\u3002\n<\/p>\n<p>\n\t\u6a21\u5f0f\u3001\u6570\u5b57\u5bf9\u5e94\u5982\u4e0b\uff1a\n<\/p>\n<ul>\n<li>\n\t\trwx:7&nbsp;\n\t<\/li>\n<li>\n\t\trw-:6&nbsp;\n\t<\/li>\n<li>\n\t\tr-x:5&nbsp;\n\t<\/li>\n<li>\n\t\tr&#8211;:4&nbsp;\n\t<\/li>\n<li>\n\t\t-wx:3&nbsp;\n\t<\/li>\n<li>\n\t\t-w-:2&nbsp;\n\t<\/li>\n<li>\n\t\t&#8211;x:1&nbsp;\n\t<\/li>\n<li>\n\t\t&#8212;:0\n\t<\/li>\n<\/ul>\n<p>\n\t[mode]\u662f\u4e00\u4e2a3\u4f4d\u516b\u8fdb\u5236\u6570\uff1a\n<\/p>\n<p>\n\t\u7b2c\u4e00\u4f4d\u8868\u793a\u521b\u5efa\u8005\u6743\u9650<br \/>\n\t\u7b2c\u4e8c\u4f4d\u8868\u793a\u7ec4\u7528\u6237\u6743\u9650<br \/>\n\t\u7b2c\u4e09\u4f4d\u8868\u793a\u5176\u4ed6\u7528\u6237\u6743\u9650\n<\/p>\n<p>\n\t\u66f4\u5177\u4f53\u7684\uff1a\n<\/p>\n<ul>\n<li>\n\t\t400\uff1a\u521b\u5efa\u8005\u53ef\u8bfb\n\t<\/li>\n<li>\n\t\t200\uff1a\u521b\u5efa\u8005\u53ef\u5199\n\t<\/li>\n<li>\n\t\t100\uff1a\u521b\u5efa\u8005\u53ef\u6267\u884c\n\t<\/li>\n<li>\n\t\t040\uff1a\u7ec4\u7528\u6237\u53ef\u8bfb\n\t<\/li>\n<li>\n\t\t020\uff1a\u7ec4\u7528\u6237\u53ef\u5199\n\t<\/li>\n<li>\n\t\t010\uff1a\u7ec4\u7528\u6237\u53ef\u6267\u884c\n\t<\/li>\n<li>\n\t\t004\uff1a\u5176\u4ed6\u7528\u6237\u53ef\u8bfb\n\t<\/li>\n<li>\n\t\t002\uff1a\u5176\u4ed6\u7528\u6237\u53ef\u5199\n\t<\/li>\n<li>\n\t\t001\uff1a\u5176\u4ed6\u7528\u6237\u53ef\u6267\u884c\n\t<\/li>\n<\/ul>\n<p>\n\t3\u4f4d\u5bf9\u5e94\u4f4d\u7684\u5bf9\u5e94\u6570\u5b57\u52a0\u8d77\u6765\uff0c\u6700\u7ec8\u5c31\u662f\u4e09\u7c7b\u7528\u6237\u7684\u6700\u7ec8\u6743\u9650\u3002\n<\/p>\n<p>\n\t\u5982\u4f55\u56de\u6536\u975e\u521b\u5efa\u8005\u7528\u6237\u5bf9xttblog.sh\u7684\u6240\u6709\u6743\u9650\uff1f\n<\/p>\n<pre class=\"brush:bash;\">\r\nchmod 700 xttblog.sh<\/pre>\n<ul>\n<li>\n\t\t\u7b2c\u4e00\u4f4d7\uff1a4+2+1\uff0c\u521b\u5efa\u8005\uff0c\u53ef\u8bfb\u53ef\u5199\u53ef\u6267\u884c\n\t<\/li>\n<li>\n\t\t\u7b2c\u4e8c\u4f4d0\uff1a\u7ec4\u7528\u6237\uff0c\u65e0\u6743\u9650\n\t<\/li>\n<li>\n\t\t\u7b2c\u4e09\u4f4d0\uff1a\u5176\u4ed6\u7528\u6237\uff0c\u65e0\u6743\u9650\n\t<\/li>\n<\/ul>\n<p>\n\txttblog.sh\u53ea\u5141\u8bb8\u521b\u5efa\u8005\u4fee\u6539\uff0c\u5141\u8bb8\u5176\u4ed6\u7528\u6237\u8bfb\u53d6\u548c\u6267\u884c\uff0c\u600e\u4e48\u8bbe\u7f6e\uff1f\n<\/p>\n<pre class=\"brush:bash;\">\r\nchmod 755 xttblog.sh<\/pre>\n<ul>\n<li>\n\t\t\u7b2c\u4e00\u4f4d7\uff1a4+2+1\uff0c\u521b\u5efa\u8005\uff0c\u53ef\u8bfb\u53ef\u5199\u53ef\u6267\u884c\n\t<\/li>\n<li>\n\t\t\u7b2c\u4e8c\u4f4d5\uff1a4+1\uff0c\u7ec4\u7528\u6237\uff0c\u53ef\u8bfb\u53ef\u6267\u884c\n\t<\/li>\n<li>\n\t\t\u7b2c\u4e09\u4f4d5\uff1a4+1\uff0c\u5176\u4ed6\u7528\u6237\uff0c\u53ef\u8bfb\u53ef\u6267\u884c\n\t<\/li>\n<\/ul>\n<p>\n\t\u4e00\u822c\u6765\u8bf4\uff0c\u5199\u4e86\u4e00\u4e2a\u5de5\u5177\uff0c\u53ea\u5141\u8bb8\u81ea\u5df1\u4fee\u6539\uff0c\u4e0d\u5141\u8bb8\u522b\u4eba\u4fee\u6539\uff0c\u4f46\u5141\u8bb8\u522b\u4eba\u4f7f\u7528\uff0c\u8fd9\u5c31\u662f755\u3002<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=3049\">Linux\u6743\u9650\u7ba1\u7406chmod 755(chmod xxx)\u6559\u7a0b<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u6ca1\u600e\u4e48\u64cd\u4f5c\u8fc7 Linux \u7684\u4eba\uff0c\u603b\u662f\u5f88\u597d\u5947\uff0c\u4e3a\u4ec0\u4e48\u4f60\u6267\u884c chmod 755 \u540e\uff0c\u8fd9\u4e2a\u6587\u4ef6\u6211\u5c31\u53ef\u4ee5\u64cd\u4f5c\u4e86\u5462\uff1fc [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[118,6],"tags":[1677,706,1394,679,389],"class_list":["post-3049","post","type-post","status-publish","format-standard","hentry","category-ndisdevelop","category-yyzt","tag-chmod","tag-linux","tag-win7","tag-389"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3049","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3049"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3049\/revisions"}],"predecessor-version":[{"id":3050,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/3049\/revisions\/3050"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3049"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3049"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3049"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}