{"id":1183,"date":"2012-10-12T09:01:29","date_gmt":"2012-10-12T01:01:29","guid":{"rendered":"http:\/\/www.huzs.top\/?p=1183"},"modified":"2012-10-12T09:01:29","modified_gmt":"2012-10-12T01:01:29","slug":"linux%e4%b8%8b%e7%9a%84%e6%96%87%e4%bb%b6%e6%9d%83%e9%99%90","status":"publish","type":"post","link":"https:\/\/www.huzs.top\/?p=1183","title":{"rendered":"Linux\u4e0b\u7684\u6587\u4ef6\u6743\u9650"},"content":{"rendered":"<div>\u3000\u3000\u6211\u4eec\u5df2\u7ecf\u77e5\u9053\u6587\u4ef6\u6743\u9650\u5bf9\u4e8e\u7cfb\u7edf\u7684\u5b89\u5168\u91cd\u8981\u6027\u4e86\uff0c\u4e5f\u77e5\u9053\u6587\u4ef6\u6743\u9650\u4e0e\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7684\u5173\u7cfb\u4e86\uff0c\u90a3\u4e48\uff0c\u5982\u4f55\u4fee\u6539\u6587\u4ef6\u7684\u6743\u9650\u5462\uff1f\u6211\u4eec\u53ef\u4ee5\u4fee\u6539\u591a\u5c11\u6587\u4ef6\u6743\u9650\u5462\uff1f\u5176\u5b9e\uff0c\u4e00\u4e2a\u6587\u4ef6\u7684\u6743\u9650\u5f88\u591a\u3002\u6211\u4eec\u5148\u4ecb\u7ecd\u51e0\u4e2a\u7b80\u5355\u7684\uff0c\u4f8b\u5982\uff1a\u7528\u6237\u7ec4\u3001\u62e5\u6709\u8005\u3001\u5404\u79cd\u8eab\u4efd\u7684\u6743\u9650\u7b49\u7b49\u3002<\/div>\n<p><\/p>\n<div><\/div>\n<p><\/p>\n<div>\u2022\u00a0chgrp\uff1a\u6539\u53d8\u6587\u4ef6\u6240\u5c5e\u7528\u6237\u7ec4 \u3002<br \/>\u2022\u00a0chown\uff1a\u6539\u53d8\u6587\u4ef6\u62e5\u6709\u8005\u3002<br \/>\u2022\u00a0chmod\uff1a\u6539\u53d8\u6587\u4ef6\u7684\u5c5e\u6027\u3001SUID\u7b49\u7279\u6027\u3002<\/div>\n<p><\/p>\n<div><\/div>\n<p><\/p>\n<div><strong>\u66f4\u6539\u6240\u5c5e\u7528\u6237\u7ec4, chgrp<\/strong><\/div>\n<p><\/p>\n<div>\u3000\u3000\u6539\u53d8\u6587\u4ef6\u7684\u7528\u6237\u7ec4\u5f88\u7b80\u5355\uff0c\u76f4\u63a5\u7528chgrp\u5373\u53ef\uff0c\u8fd9\u4e2a\u547d\u4ee4\u5c31\u662fchange group\uff08\u6539\u53d8\u7528\u6237\u7ec4\uff09\u7684\u7f29\u5199\u3002\u8fd9\u6837\u5c31\u5f88\u597d\u8bb0\u4e86\u3002\u4e0d\u8fc7\uff0c\u8bf7\u8bb0\u4f4f\uff0c\u8981\u6539\u53d8\u6210\u4e3a\u7684\u7528\u6237\u7ec4\u540d\u79f0\uff0c\u5fc5\u987b\u5728 \/etc\/group\u91cc\u5b58\u5728\uff0c\u5426\u5219\u5c31\u4f1a\u663e\u793a\u9519\u8bef\u3002<\/div>\n<p><\/p>\n<div>\u3000\u3000\u5047\u8bbe\u4ee5root\u7684\u8eab\u4efd\u767b\u5165FC4\uff0c\u90a3\u4e48\uff0c\u5728\u4f60\u7684\u5bb6\u76ee\u5f55\u5185\u6709\u4e00\u4e2ainstall.log\u6587\u4ef6\uff0c\u5982\u4f55\u6539\u53d8\u8be5\u6587\u4ef6\u7684\u7528\u6237\u7ec4\u5462\uff1f\u5047\u8bbe\u4f60\u5df2\u7ecf\u77e5\u9053\u5728 \/etc\/group\u91cc\u5df2\u7ecf\u5b58\u5728\u4e00\u4e2a\u540d\u4e3ausers\u7684\u7528\u6237\u7ec4\uff0c\u4f46\u662f\uff0ctesting\u8fd9\u4e2a\u7528\u6237\u7ec4\u540d\u5b57\u5c31\u4e0d\u5b58\u5728 \/etc\/group\u4e2d\u4e86\uff0c\u6b64\u65f6\u6539\u53d8\u7528\u6237\u7ec4\u6210\u4e3ausers\u4e0etesting\uff0c\u4f1a\u6709\u4ec0\u4e48\u73b0\u8c61\u53d1\u751f\u5462\uff1f<!--more--><\/div>\n<p><\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# chgrp [-R] dirname\/filename ...<br>\u53c2\u6570\uff1a<br>-R : \u8fdb\u884c\u9012\u5f52( recursive )\u7684\u6301\u7eed\u66f4\u6539\uff0c\u5373\u8fde\u540c\u5b50\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u3001\u76ee\u5f55<br>\u90fd\u66f4\u65b0\u6210\u4e3a\u8fd9\u4e2a\u7528\u6237\u7ec4\u3002\u5e38\u5e38\u7528\u5728\u66f4\u6539\u67d0\u4e00\u76ee\u5f55\u7684\u60c5\u51b5\u3002<br>\u8303\u4f8b\uff1a<br>[root@linux ~]# chgrp users install.log<br>[root@linux ~]# ls -l<br>-rw-r--r--\u00a0 1 root users 68495 Jun 25 08:53 install.log<br>[root@linux ~]# chgrp testing install.log<br>chgrp: invalid group name `testing' &lt;== \u51fa\u73b0\u9519\u8bef\u4fe1\u606f\uff5e\u627e\u4e0d\u5230\u8fd9\u4e2a\u7528\u6237\u7ec4\u540d\uff5e<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u53d1\u73b0\u4e86\u5417\uff1f\u6587\u4ef6\u7684\u7528\u6237\u7ec4\u88ab\u6539\u6210users\u4e86\uff0c\u4f46\u8981\u6539\u6210testing\u7684\u65f6\u5019\uff0c\u5c31\u4f1a\u53d1\u751f\u9519\u8bef\u3002\u6ce8\u610f\uff0c\u51fa\u73b0\u9519\u8bef\u4fe1\u606f\uff0c\u8fd8\u662f\u8981\u67e5\u67e5\u9519\u8bef\u4fe1\u606f\u7684\u5185\u5bb9\u624d\u597d\u3002<br \/><strong>\u66f4\u6539\u6587\u4ef6\u62e5\u6709\u8005, chown<\/strong><br \/>\u90a3 \u4e48\uff0c\u5982\u4f55\u6539\u53d8\u4e00\u4e2a\u6587\u4ef6\u7684\u62e5\u6709\u8005\u5462\uff1f\u5f88\u7b80\u5355\u3002\u65e2\u7136\u6539\u53d8\u7528\u6237\u7ec4\u662fchange group\uff0c\u90a3\u4e48\u6539\u53d8\u62e5\u6709\u8005\u5c31\u662fchange owner\uff08\u6539\u53d8\u62e5\u6709\u8005\uff09\u3002\u8fd9\u5c31\u662fchown\u8fd9\u4e2a\u547d\u4ee4\u7684\u7528\u9014\uff0c\u8981\u6ce8\u610f\u7684\u662f\uff0c\u7528\u6237\u5fc5\u987b\u662f\u5df2\u7ecf\u5b58\u5728\u7cfb\u7edf\u4e2d\u7684\uff0c\u4e5f\u5c31\u662f\u5728 \/etc\/passwd\u8fd9\u4e2a\u6587\u4ef6\u4e2d\u6709\u8bb0\u5f55\u7684\u7528\u6237\u540d\u79f0\u624d\u53ef\u6539\u53d8\u3002<br \/>chown\u7684\u7528\u9014\u5f88\u591a\uff0c\u8fd8\u53ef\u4ee5\u987a\u4fbf\u76f4\u63a5\u4fee\u6539\u7528\u6237\u7ec4\u7684\u540d\u79f0\u3002\u6b64\u5916\uff0c\u5982\u679c\u8981\u8fde\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u5b50\u76ee\u5f55\u6216\u6587\u4ef6\u540c\u65f6\u66f4\u6539\u6587\u4ef6\u62e5\u6709\u8005\u7684\u8bdd\uff0c\u76f4\u63a5\u52a0\u4e0a -R\u7684\u53c2\u6570\u5373\u53ef\u3002\u6211\u4eec\u6765\u770b\u770b\u8bed\u6cd5\u4e0e\u8303\u4f8b\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# chown [-R] \u8d26\u53f7\u540d\u79f0 \u6587\u4ef6\u6216\u76ee\u5f55<br>[root@linux ~]# chown [-R] \u8d26\u53f7\u540d\u79f0:\u7528\u6237\u7ec4\u540d\u79f0 \u6587\u4ef6\u6216\u76ee\u5f55<br>\u53c2\u6570\uff1a<br>-R : \u8fdb\u884c\u9012\u5f52( recursive )\u7684\u6301\u7eed\u66f4\u6539\uff0c\u5373\u8fde\u540c\u5b50\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u3001\u76ee\u5f55<br>\u90fd\u66f4\u65b0\u6210\u4e3a\u8fd9\u4e2a\u7528\u6237\u7ec4\u3002\u5e38\u5e38\u7528\u5728\u66f4\u6539\u67d0\u4e00\u76ee\u5f55\u7684\u60c5\u51b5\u3002<br>\u8303\u4f8b\uff1a<br>[root@linux ~]# chown bin install.log<br>[root@linux ~]# ls -l<br>-rw-r--r--\u00a0 1 bin\u00a0 users 68495 Jun 25 08:53 install.log<br>[root@linux ~]# chown root:root install.log<br>[root@linux ~]# ls -l<br>-rw-r--r--\u00a0 1 root root 68495 Jun 25 08:53 install.log<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u6211\u4eec\u77e5\u9053\u5982\u4f55\u6539\u53d8\u6587\u4ef6\u7684\u7528\u6237\u7ec4\u4e0e\u62e5\u6709\u8005\u4e86\uff0c\u90a3\u4e48\uff0c\u4ec0\u4e48\u65f6\u5019\u8981\u4f7f\u7528chown\u6216chgrp\u5462\uff1f\u6216\u8bb8\u4f60\u4f1a\u89c9\u5f97\u5947\u602a\u5427\uff1f\u662f\u7684\uff0c\u786e\u5b9e\u6709\u65f6\u5019\u9700\u8981\u66f4\u6539\u6587\u4ef6\u7684\u62e5\u6709\u8005\u7684\uff0c\u6700\u5e38\u89c1\u7684\u4f8b\u5b50\u5c31\u662f\u5728\u590d\u5236\u6587\u4ef6\u7ed9\u5176\u4ed6\u4eba\u65f6\uff0c\u6211\u4eec\u4f7f\u7528\u6700\u7b80\u5355\u7684cp\u6765\u8bf4\u660e\u597d\u4e86\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# cp \u6765\u6e90\u6587\u4ef6 \u76ee\u7684\u6587\u4ef6<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u5047\u8bbe\u4eca\u5929\u8981\u5c06 .bashrc\u6587\u4ef6\u590d\u5236\u6210\u4e3a .bashrc_test\uff0c\u4e14\u662f\u8981\u7ed9bin\u8fd9\u4e2a\u4eba\uff0c\u4f60\u53ef\u4ee5\u8fd9\u6837\u505a\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# cp .bashrc .bashrc_test<br>[root@linux ~]# ls -al .bashrc*<br>-rw-r--r--\u00a0 1 root root 395 Jul\u00a0 4 11:45 .bashrc<br>-rw-r--r--\u00a0 1 root root 395 Jul 13 11:31 .bashrc_test<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u600e\u4e48\u529e\uff1f.bashrc_test\u8fd8\u662f\u5c5e\u4e8eroot\u6240\u6709\uff0c\u5982\u6b64\u4e00\u6765\uff0c\u5373\u4f7f\u5c06\u6587\u4ef6\u62ff\u7ed9bin\u7528\u6237\u4e86\uff0c\u4ed6\u4ecd\u7136\u65e0\u6cd5\u4fee\u6539\uff08\u770b\u5c5e\u6027\u5c31\u77e5\u9053\u4e86\uff09\uff0c\u6240\u4ee5\u5c31\u5fc5\u987b\u4fee\u6539\u8fd9\u4e2a\u6587\u4ef6\u7684\u62e5\u6709\u8005\u4e0e\u7528\u6237\u7ec4\u3002<br \/><strong>\u66f4\u65399\u4e2a\u5c5e\u6027, chmod<\/strong><br \/>\u6587\u4ef6\u5c5e\u6027\u7684\u6539\u53d8\u4f7f\u7528chmod\u547d\u4ee4\uff0c\u4f46\u662f\uff0c\u5c5e\u6027\u7684\u8bbe\u7f6e\u65b9\u6cd5\u6709\u4e24\u79cd\uff0c\u5206\u522b\u53ef\u4ee5\u4f7f\u7528\u6570\u5b57\u6216\u8005\u662f\u7b26\u53f7\u3002<br \/>\u2022\u00a0\u6570\u5b57\u7c7b\u578b\u6539\u53d8\u6587\u4ef6\u6743\u9650<br \/>Linux\u6587\u4ef6\u7684\u57fa\u672c\u5c5e\u6027\u67099\u4e2a\uff0c\u5206\u522b\u662fowner\/group\/others\u7ec4\u522b\u7684read\/write\/ excute\u5c5e\u6027\uff0c\u5148\u590d\u4e60\u4e00\u4e0b\u521a\u521a\u4e0a\u9762\u63d0\u5230\u7684\u6570\u636e\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>-rwxrwxrwx<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u8fd99\u4e2a\u5c5e\u6027\u662f\u4e09\u4e2a\u4e00\u7ec4\u3002\u5176\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528\u6570\u5b57\u6765\u8868\u793a\u5404\u4e2a\u5c5e\u6027\uff0c\u5404\u5c5e\u6027\u7684\u5bf9\u7167\u8868\u5982\u4e0b\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>r:4<br>w:2<br>x:1<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u540c\u4e00\u7ec4\uff08owner\/group\/others\uff09\u76843\u4e2a\u5c5e\u6027\uff08r\/w\/x\uff09\u662f\u9700\u8981\u7d2f\u52a0\u7684\uff0c\u4f8b\u5982\u5f53\u5c5e\u6027\u4e3a [-rwxrwx&#8212;] \u5219\u662f\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>owner = rwx = 4+2+1 = 7<br>group = rwx = 4+2+1 = 7<br>others= --- = 0+0+0 = 0<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u6240\u4ee5\uff0c\u7b49\u4e00\u4e0b\u8bbe\u7f6e\u5c5e\u6027\u7684\u66f4\u6539\u65f6\uff0c\u8be5\u5c5e\u6027\u7684\u6570\u5b57\u5c31\u662f770\u3002\u66f4\u6539\u5c5e\u6027\u7684\u547d\u4ee4chmod\u7684\u8bed\u6cd5\u662f\u8fd9\u6837\u7684\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# chmod [-R] xyz \u6587\u4ef6\u6216\u76ee\u5f55<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u53c2\u6570\uff1a<br \/>xyz : \u5c31\u662f\u521a\u521a\u63d0\u5230\u7684\u6570\u5b57\u7c7b\u578b\u7684\u6743\u9650\u5c5e\u6027\uff0c\u4e3a rwx \u5c5e\u6027\u6570\u503c\u7684\u76f8\u52a0\u3002<br \/>-R\u00a0 : \u8fdb\u884c\u9012\u5f52( recursive )\u7684\u6301\u7eed\u66f4\u6539\uff0c\u5373\u8fde\u540c\u5b50\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u3001\u76ee\u5f55\u90fd\u66f4\u65b0\u6210\u4e3a\u8fd9\u4e2a\u7528\u6237\u7ec4\u3002\u5e38\u5e38\u7528\u5728\u66f4\u6539\u67d0\u4e00\u76ee\u5f55\u7684\u60c5\u51b5\u3002<br \/>\u4e3e\u4f8b\u6765\u8bf4\uff0c\u5982\u679c\u8981\u5c06 .bashrc\u8fd9\u4e2a\u6587\u4ef6\u6240\u6709\u7684\u5c5e\u6027\u90fd\u6253\u5f00\uff0c\u90a3\u4e48\u5c31\u53d1\u51fa\u547d\u4ee4\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# ls -al .bashrc<br>-rw-r--r--\u00a0 1 root root 395 Jul\u00a0 4 11:45 .bashrc<br>[root@linux ~]# chmod 777 .bashrc<br>[root@linux ~]# ls -al .bashrc<br>-rwxrwxrwx\u00a0 1 root root 395 Jul\u00a0 4 11:45 .bashrc<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u770b\u5230\u4e86\u5417\uff1f\u5c5e\u6027\u6539\u53d8\u4e86\u3002\u7531\u4e8e\u4e00\u4e2a\u6587\u4ef6\u6709\u4e09\u7ec4\u5c5e\u6027\uff0c\u6240\u4ee5\u53ef\u4ee5\u53d1\u73b0\u4e0a\u9762777\u4e3a\u4e09\u7ec4\uff0c\u800c\u7531\u4e8e\u6211\u4eec\u5c06\u6240\u6709\u7684\u5c5e\u6027\u90fd\u6253\u5f00\uff0c\u6240\u4ee5\u6570\u5b57\u90fd\u76f8\u52a0\uff0c\u5373\u201cr+w+x = 4+2+1 = 7\u201d\u3002<br \/>\u5982 \u679c\u8981\u5c06\u5c5e\u6027\u53d8\u6210\u201c-rwxr-xr&#8211;\u201d\u5462\uff1f\u90a3\u4e48\u5c31\u6210\u4e3a [4+2+1][4+0+1][4+0+0]=754\u3002\u6240\u4ee5\u9700\u8981\u53d1\u51fa\u547d\u4ee4chmod 754 filename\u3002\u6700\u5e38\u53d1\u751f\u7684\u4e00\u4e2a\u95ee\u9898\u5c31\u662f\uff0c\u5e38\u5e38\u6211\u4eec\u4ee5vi\u7f16\u8f91shell\u7684\u6587\u5b57\u6587\u4ef6\u540e\uff0c\u5176\u5c5e\u6027\u901a\u5e38\u662f -rw-rw-rw-\uff0c\u4e5f\u5c31\u662f666\u5c5e\u6027\uff0c\u5982\u679c\u8981\u5c06\u5b83\u53d8\u6210\u53ef\u6267\u884c\u6587\u4ef6\uff0c\u5e76\u4e14\u4e0d\u8981\u8ba9\u5176\u4ed6\u4eba\u4fee\u6539\u6b64\u6587\u4ef6\u7684\u8bdd\uff0c\u90a3\u4e48\u5c31\u9700\u8981 -rwxr-xr-x\u8fd9\u4e2a755\u7684\u5c5e\u6027\uff0c\u6240\u4ee5\u5c31\u8981\u4f7f\u7528chmod 755 test.sh\u3002<br \/>\u53e6\u5916\uff0c\u6709\u4e9b\u6587\u4ef6\u4e0d\u5e0c\u671b\u88ab\u5176\u4ed6\u4eba\u770b\u5230\uff0c\u4f8b\u5982 -rwxr&#8212;&#8211;\uff0c\u90a3\u4e48\u5c31\u4f7f\u7528\u547d\u4ee4chmod 740 filename\u3002<\/p>\n<div align=\"center\"><\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td valign=\"top\" width=\"491\"><\/p>\n<div><span style=\"font-size: small;\">\u4f8b\u98983\uff1a\u5c06 <\/span><span style=\"font-family: Courier New;\">.bashrc<\/span><span style=\"font-size: small;\">\u6587\u4ef6\u7684\u5c5e\u6027\u6539\u56de\u539f\u6765\u7684 <\/span><span style=\"font-family: Courier New;\">-rw-r&#8211;r&#8211;<\/span><span style=\"font-size: small;\">\u3002<\/span><\/div>\n<p><\/p>\n<div><span style=\"font-size: small;\">\u7b54\uff1a<\/span><\/div>\n<p><\/p>\n<div><span style=\"font-family: \u5b8b\u4f53,MS Song;\">chmod 644 .bashrc<\/span><\/div>\n<\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p><\/div>\n<p>\u2022\u00a0\u7b26\u53f7\u7c7b\u578b\u6539\u53d8\u6587\u4ef6\u6743\u9650<br \/>\u8fd8 \u6709\u4e00\u4e2a\u6539\u53d8\u5c5e\u6027\u7684\u65b9\u6cd5\u3002\u4ece\u4e4b\u524d\u7684\u4ecb\u7ecd\u4e2d\u53ef\u4ee5\u53d1\u73b0\uff0c\u57fa\u672c\u4e0a\u5c319\u4e2a\u5c5e\u6027\uff0c\u5206\u522b\u662f (1)user (2)group (3)others\u4e09\u7ec4\u3002\u6211\u4eec\u5c31\u53ef\u4ee5\u901a\u8fc7u, g, o\u6765\u8868\u793a\u4e09\u7ec4\u7684\u5c5e\u6027\u3002\u6b64\u5916\uff0ca\u8868\u793aall\uff0c\u5373\u5168\u90e8\u7684\u4e09\u7ec4\u3002\u8bfb\u5199\u5c5e\u6027\u53ef\u4ee5\u5199\u6210r, w, x\u3002\u4e5f\u5c31\u662f\u53ef\u4ee5\u4f7f\u7528\u4e0b\u9762\u7684\u65b9\u5f0f\u6765\u770b\uff1a<\/p>\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"0\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td width=\"113\"><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">chmod<\/span><\/span><\/div>\n<\/td>\n<p><\/p>\n<td width=\"38\"><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">u<\/span><\/span><\/div>\n<p><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">g<\/span><\/span><\/div>\n<p><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">o<\/span><\/span><\/div>\n<p><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">a<\/span><\/span><\/div>\n<\/td>\n<p><\/p>\n<td width=\"132\"><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">+<\/span>\uff08\u52a0\u5165\uff09<\/span><\/div>\n<p><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">&#8211;<\/span>\uff08\u9664\u53bb\uff09<\/span><\/div>\n<p><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">=<\/span>\uff08\u8bbe\u7f6e\uff09<\/span><\/div>\n<\/td>\n<p><\/p>\n<td width=\"38\"><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">r<\/span><\/span><\/div>\n<p><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">w<\/span><\/span><\/div>\n<p><\/p>\n<div align=\"center\"><span style=\"font-size: small;\"><span style=\"font-family: Courier New;\">x<\/span><\/span><\/div>\n<\/td>\n<p><\/p>\n<td width=\"146\"><\/p>\n<div align=\"center\"><span style=\"font-size: small;\">\u6587\u4ef6\u6216\u76ee\u5f55<\/span><\/div>\n<\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u5047\u5982\u6211\u4eec\u8981\u201c\u8bbe\u7f6e\u201d\u4e00\u4e2a\u6587\u4ef6\u7684\u5c5e\u6027\u4e3a\u201c-rwxr-xr-x\u201d\uff0c\u57fa\u672c\u4e0a\u5c31\u662f\uff1a<br \/>\uf06e\u00a0user (u)\uff1a\u5177\u6709\u53ef\u8bfb\u3001\u53ef\u5199\u3001\u53ef\u6267\u884c\u7684\u6743\u9650\u3002<br \/>\uf06e\u00a0group\u4e0eothers (g\/o)\uff1a\u5177\u6709\u53ef\u8bfb\u4e0e\u6267\u884c\u7684\u6743\u9650\u3002<br \/>\u6240\u4ee5\u5c31\u662f\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# chmod\u00a0 u=rwx,go=rx\u00a0 .bashrc<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p># \u6ce8\u610f\u3002\u90a3\u4e2a u=rwx,go=rx \u662f\u8fde\u5728\u4e00\u8d77\u7684\uff0c\u4e2d\u95f4\u5e76\u6ca1\u6709\u4efb\u4f55\u7a7a\u683c\u3002<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# ls -al .bashrc<br>-rwxr-xr-x\u00a0 1 root root 395 Jul\u00a0 4 11:45 .bashrc<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u8bf7 \u6ce8\u610f\uff0cr=rwx,og=rx\u8fd9\u4e00\u6bb5\u6587\u5b57\u4e4b\u95f4\u5e76\u6ca1\u6709\u7a7a\u683c\u9694\u5f00\u3002\u90a3\u4e48\uff0c\u5047\u5982\u662f\u201c-rwxr-xr&#8211;\u201d\uff1f\u53ef\u4ee5\u4f7f\u7528\u201cchmod u=rwx,g=rx,o=r filename\u201d\u6765\u8bbe\u7f6e\u3002\u6b64\u5916\uff0c\u5982\u679c\u4e0d\u77e5\u9053\u539f\u5148\u7684\u6587\u4ef6\u5c5e\u6027\uff0c\u800c\u53ea\u60f3\u8981\u589e\u52a0 .bashrc\u6587\u4ef6\u7684\u6bcf\u4e2a\u4eba\u5747\u53ef\u5199\u5165\u7684\u6743\u9650\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u4f7f\u7528\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# ls -al .bashrc<br>-rwxr-xr-x\u00a0 1 root root 395 Jul\u00a0 4 11:45 .bashrc<br>[root@linux ~]# chmod\u00a0 a+w\u00a0 .bashrc<br>[root@linux ~]# ls -al .bashrc<br>-rwxrwxrwx\u00a0 1 root root 395 Jul\u00a0 4 11:45 .bashrc<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u800c\u5982\u679c\u662f\u8981\u5c06\u5c5e\u6027\u53bb\u6389\uff0c\u800c\u4e0d\u66f4\u6539\u5176\u4ed6\u5c5e\u6027\u5462\uff1f\u4f8b\u5982\u8981\u53bb\u6389\u6240\u6709\u4eba\u7684x\u5c5e\u6027\uff0c\u5219\uff1a<\/p>\n<table width=\"400\" border=\"1\" cellspacing=\"0\" cellpadding=\"2\" align=\"center\"><\/p>\n<tbody><\/p>\n<tr><\/p>\n<td bgcolor=\"#e6e6e6\"><\/p>\n<pre>[root@linux ~]# chmod\u00a0 a-x\u00a0 .bashrc<br>[root@linux ~]# ls -al .bashrc<br>-rw-rw-rw-\u00a0 1 root root 395 Jul\u00a0 4 11:45 .bashrc<\/pre>\n<p><\/td>\n<p><\/tr>\n<p><\/tbody>\n<p><\/table>\n<p>\u77e5 \u9053 +, -, = \u7684\u4e0d\u540c\u70b9\u4e86\u5417\uff1f+ \u4e0e &#8211; \u7684\u72b6\u6001\u4e0b\uff0c\u53ea\u8981\u662f\u6ca1\u6709\u6307\u5b9a\u5230\u7684\u9879\u76ee\uff0c\u5219\u8be5\u5c5e\u6027\u201c\u4e0d\u4f1a\u53d8\u52a8\u201d\u3002\u4f8b\u5982\uff0c\u4e0a\u9762\u7684\u4f8b\u5b50\u4e2d\uff0c\u7531\u4e8e\u4ec5\u4ee5 &#8211; \u53bb\u6389x\uff0c\u5219\u5176\u4ed6\u4e24\u4e2a\u4fdd\u6301\u5f53\u65f6\u7684\u503c\u4e0d\u53d8\u3002\u591a\u591a\u7ec3\u4e60\u4e00\u4e0b\uff0c\u4f60\u5c31\u4f1a\u77e5\u9053\u5982\u4f55\u6539\u53d8\u5c5e\u6027\u3002\u8fd9\u5728\u67d0\u4e9b\u60c5\u51b5\u4e0b\u5f88\u597d\u7528\u3002\u4e3e\u4f8b\u6765\u8bf4\uff0c\u4f60\u60f3\u8981\u6559\u4e00\u4e2a\u4eba\u5982\u4f55\u8ba9\u4e00\u4e2a\u7a0b\u5e8f\u53ef\u4ee5\u62e5\u6709\u6267 \u884c\u7684\u6743\u9650\uff0c\u53c8\u4e0d\u77e5\u9053\u8be5\u6587\u4ef6\u539f\u672c\u7684\u6743\u9650\u662f\u4ec0\u4e48\uff0c\u6b64\u65f6\uff0c\u5229\u7528chmod a+x filename\uff0c\u5c31\u53ef\u4ee5\u8ba9\u8be5\u7a0b\u5e8f\u62e5\u6709\u6267\u884c\u7684\u6743\u9650\u4e86\u3002\u5f88\u65b9\u4fbf\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u3000\u3000\u6211\u4eec\u5df2\u7ecf\u77e5\u9053\u6587\u4ef6\u6743\u9650\u5bf9\u4e8e\u7cfb\u7edf\u7684\u5b89\u5168\u91cd\u8981\u6027\u4e86\uff0c\u4e5f\u77e5\u9053\u6587\u4ef6\u6743\u9650\u4e0e\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7684\u5173\u7cfb\u4e86\uff0c\u90a3\u4e48\uff0c\u5982\u4f55\u4fee\u6539\u6587\u4ef6\u7684\u6743\u9650 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-1183","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/1183","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1183"}],"version-history":[{"count":1,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/1183\/revisions"}],"predecessor-version":[{"id":1184,"href":"https:\/\/www.huzs.top\/index.php?rest_route=\/wp\/v2\/posts\/1183\/revisions\/1184"}],"wp:attachment":[{"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1183"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1183"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.huzs.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1183"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}