[root@www ~]# ls -al\ntotal 156\ndrwxr-x--- 4 root root 4096 Sep 8 14:06 .\ndrwxr-xr-x 23 root root 4096 Sep 8 14:21 ..\n-rw------- 1 root root 1474 Sep 4 18:27 anaconda-ks.cfg\n-rw------- 1 root root 199 Sep 8 17:14 .bash_history\n-rw-r--r-- 1 root root 24 Jan 6 2007 .bash_logout\n-rw-r--r-- 1 root root 191 Jan 6 2007 .bash_profile\n-rw-r--r-- 1 root root 176 Jan 6 2007 .bashrc\n-rw-r--r-- 1 root root 100 Jan 6 2007 .cshrc\ndrwx------ 3 root root 4096 Sep 5 10:37 .gconf\ndrwx------ 2 root root 4096 Sep 5 14:09 .gconfd\n-rw-r--r-- 1 root root 42304 Sep 4 18:26 install.log\n-rw-r--r-- 1 root root 5661 Sep 4 18:25 install.log.syslog\n[ 1 ][ 2 ][ 3 ][ 4 ][ 5 ][ 6 ][ 7 ]\n[ \u6743\u9650 ] [\u8fde\u63a5] [\u62e5\u6709\u8005][\u7fa4\u7ec4] [\u6587\u4ef6\u5bb9\u91cf] [ \u4fee\u6539\u65e5\u671f ] [ \u6863\u540d ]<\/code><\/pre>\n<\/p>\n<\/p>\n
\u5bf9\u6587\u4ef6\u6765\u8bb2\uff0c\u6743\u9650\u7684\u6548\u80fd\u4e3a\uff1a<\/p>\n
\u5bf9\u76ee\u5f55\u6765\u8bf4\uff0c\u6743\u9650\u7684\u5c5e\u80fd\u4e3a\uff1a2.Linux\u4e0b\u7684\u6587\u4ef6\u7c7b\u578b\u4e0e\u6269\u5145\u540d<\/p>\n
\u7b2c\u4e00\u4e2a\u5b57\u7b26\u6240\u4ee3\u8868\u7684\u662f\u6587\u4ef6\u7c7b\u578b\u3002<\/p>\n
\u57fa\u672c\u4e0aLinux\u4e0b\u6ca1\u6709\u6240\u8c13\u7684\"\u6269\u5145\u540d\"\uff0c\u4e00\u4e2a\u6587\u4ef6\u80fd\u591f\u88ab\u6267\u884c\u4e0e\u5b83\u540e\u9762\u768410\u4e2a\u5c5e\u6027\u6709\u5173\u3002\u4f46\u662f\u53ef\u4ee5\u88ab\u6267\u884c\u548c\u53ef\u4ee5\u6267\u884c\u6210\u529f\u662f\u4e0d\u4e00\u6837\u7684\u3002\u80fd\u591f\u6267\u884c\u6210\u529f\u5fc5\u9700\u8981\u770b\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u770b\u662f\u5426\u6709\u53ef\u6267\u884c\u7684\u6570\u636e\u3002<\/p>\n
Linux\u4e0b\u7684\"\u6269\u5145\u540d\"\u4f7f\u7528\u6765\u8868\u793a\u8be5\u6587\u4ef6\u662f\u54ea\u4e9b\u79cd\u7c7b\uff0c\u5e2e\u52a9\u6211\u4eec\u66f4\u597d\u7684\u4e86\u89e3\u6587\u4ef6\u7684\u7528\u9014\u800c\u5df2\uff0c\u4e0b\u8fb9\u6709\u6570\u79cd\u5e38\u7528\u7684\u6269\u5145\u540d\uff1a<\/p>\n
\u4e09.\u6587\u4ef6\u5c5e\u6027\u548c\u6743\u96501.chgrp:\u6539\u53d8\u6587\u4ef6\u6240\u5c5e\u7528\u6237\u7ec4\u8bf7\u8bb0\u5f97\uff0c\u8981\u88ab\u6539\u53d8\u7684\u7ec4\u540d\u5fc5\u9700\u8981\u5728\/etc\/group\u6587\u4ef6\u663e\u5b58\u5728\u624d\u884c\uff0c\u5426\u5219\u90fd\u4f1a\u663e\u793a\u9519\u8bef\uff01\u8bf8\u5982\uff1a<\/p>\n
<\/p>\n
\n
[root@www ~]# chgrp [-R] dirname\/filename ...\n\u9009\u9879\u4e0e\u53c2\u6570\uff1a\n-R : \u8fdb\u884c\u9012\u5f52(recursive)\u7684\u6301\u7eed\u53d8\u66f4\uff0c\u4ea6\u5373\u8fde\u540c\u6b21\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u3001\u76ee\u5f55\n \u90fd\u66f4\u65b0\u6210\u4e3a\u8fd9\u4e2a\u7fa4\u7ec4\u4e4b\u610f\u3002\u5e38\u5e38\u7528\u5728\u53d8\u66f4\u67d0\u4e00\u76ee\u5f55\u5185\u6240\u6709\u7684\u6587\u4ef6\u4e4b\u60c5\u51b5\u3002\n\u8303\u4f8b\uff1a\n[root@www ~]# chgrp users install.log\n[root@www ~]# ls -l\n-rw-r--r-- 1 root users 68495 Jun 25 08:53 install.log\n[root@www ~]# chgrp testing install.log\nchgrp: invalid group name `testing' <== \u53d1\u751f\u9519\u8bef\u8baf\u606f\uff5e\u627e\u4e0d\u5230\u8fd9\u4e2a\u7fa4\u7ec4\u540d\uff5e<\/code><\/pre>\n<\/p>\n2.chown:\u6539\u53d8\u6587\u4ef6\u6240\u6709\u8005\u53e5\u578b\u53ca\u4e3e\u4f8b\uff1a<\/p>\n
\n
[root@www ~]# chown [-R] \u8d26\u53f7\u540d\u79f0 \u6587\u4ef6\u6216\u76ee\u5f55\n[root@www ~]# chown [-R] \u8d26\u53f7\u540d\u79f0:\u7ec4\u540d \u6587\u4ef6\u6216\u76ee\u5f55\n\u9009\u9879\u4e0e\u53c2\u6570\uff1a\n-R : \u8fdb\u884c\u9012\u5f52(recursive)\u7684\u6301\u7eed\u53d8\u66f4\uff0c\u4ea6\u8fde\u540c\u6b21\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u90fd\u53d8\u66f4\n\u8303\u4f8b\uff1a\u5c06install.log\u7684\u62e5\u6709\u8005\u6539\u4e3abin\u8fd9\u4e2a\u8d26\u53f7\uff1a\n[root@www ~]# chown bin install.log\n[root@www ~]# ls -l\n-rw-r--r-- 1 bin users 68495 Jun 25 08:53 install.log\n\u8303\u4f8b\uff1a\u5c06install.log\u7684\u62e5\u6709\u8005\u4e0e\u7fa4\u7ec4\u6539\u56de\u4e3aroot\uff1a\n[root@www ~]# chown root:root install.log\n[root@www ~]# ls -l\n-rw-r--r-- 1 root root 68495 Jun 25 08:53 install.log<\/code><\/pre>\n<\/p>\n3.chmod:\u6539\u53d8\u6587\u4ef6\u6743\u9650\u6570\u5b57\u7c7b\u578b\u6539\u53d8\u6587\u4ef6\u6743\u9650<\/p>\n
\u7528\u6570\u5b57\u4ee3\u8868\u5404\u4e2a\u6743\u9650\u4e2d\u6807linux\uff0c\u5404\u6743\u9650\u7684\u5206\u6570\u5bf9\u7167\u5982\u4e0b\uff1a<\/p>\n
\u6bcf\u79cd\u8eab\u5206(owner\/group\/others)\u5404\u81ea\u7684\u4e09\u4e2a\u6743\u9650(r\/w\/x)\u5206\u6570\u662f\u987b\u8981\u7d2f\u52a0\u7684\uff0c\u6bd4\u5982\u5f53\u6743\u9650\u4e3a\uff1a<\/p>\n
[-rwxrwx---]\u5206\u6570\u5219\u662f\uff1a<\/p>\n
owner=rwx=4+2+1=7<\/p>\n
group=rwx=4+2+1=7<\/p>\n
others=---=0+0+0=0<\/p>\n
\n
[root@www ~]# chmod [-R] xyz \u6587\u4ef6\u6216\u76ee\u5f55\n\u9009\u9879\u4e0e\u53c2\u6570\uff1a\nxyz : \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\n-R : \u8fdb\u884c\u9012\u5f52(recursive)\u7684\u6301\u7eed\u53d8\u66f4\uff0c\u4ea6\u5373\u8fde\u540c\u6b21\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6\u90fd\u4f1a\u53d8\u66f4\n[root@www ~]# ls -al .bashrc\n-rw-r--r-- 1 root root 395 Jul 4 11:45 .bashrc\n[root@www ~]# chmod 777 .bashrc\n[root@www ~]# ls -al .bashrc\n-rwxrwxrwx 1 root root 395 Jul 4 11:45 .bashrc<\/strong><\/code><\/pre>\n<\/p>\n\u7b26\u53f7\u7c7b\u578b\u6539\u53d8\u6587\u4ef6\u6743\u9650<\/p>\n
chmod<\/p>\n
u<\/p>\n
g<\/p>\n
o<\/p>\n
a<\/p>\n
+(\u52a0\u5165)<\/p>\n
-(\u53bb\u9664)<\/p>\n
=(\u8bbe\u5b9a)<\/p>\n
r<\/p>\n
w<\/p>\n
x<\/p>\n
\u6587\u4ef6\u6216\u76ee\u5f55<\/p>\n
\n
[root@www ~]# chmod u=rwx,go=rx .bashrc \n# \u6ce8\u610f\uff01\u90a3\u4e2a u=rwx,go=rx \u662f\u8fde\u5728\u4e00\u8d77\u7684\uff0c\u4e2d\u95f4\u5e76\u6ca1\u6709\u4efb\u4f55\u7a7a\u683c\uff01\n[root@www ~]# ls -al .bashrc \n-rwxr-xr-x 1 root root 395 Jul 4 11:45 .bashrc \n[root@www ~]# ls -al .bashrc \n-rwxr-xr-x 1 root root 395 Jul 4 11:45 .bashrc \n[root@www ~]# chmod a+w .bashrc \n[root@www ~]# ls -al .bashrc \n-rwxrwxrwx 1 root root 395 Jul 4 11:45 .bashrc \n[root@www ~]# chmod a-x .bashrc \n[root@www ~]# ls -al .bashrc \n-rw-rw-rw- 1 root root 395 Jul 4 11:45 .bashrc<\/code><\/pre><\/p>\n","protected":false},"excerpt":{"rendered":"Linux\u7528\u6237\u8eab\u4efd\u548c\u7528\u6237\u7ec4\u8bb0\u5f55\u7684\u6587\u4ef6\u547d\u4ee4\u663e\u793a\u6587\u4ef6\u5c5e\u6027\uff0c\u7b2c\u4e00\u4e2a\u5b57\u6bb5\u662f\u6587\u4ef6\u7684\u6743\u9650\uff0c\u517110\u4f4d\uff0c\u7b2c\u4e00\u4f4d\u662f\u6587\u4ef6\u7c7b\u578b\uff0c\u63a5\u4e0b\u6765\u4e09\u4e2a\u4e3a\u4e00\u7ec4\u5171\u4e09\u7ec4\uff0c\u4e3a\u7528\u6237\u3001\u7528\u6237\u7ec4\u3001\u5176\u4ed6\u4eba\u7684\u6743\u9650\uff0c\u6743\u9650\u6709r\uff0cw\uff0cx\u4e09\u79cd\u3002\u5bf9\u6587\u4ef6\u6765\u8bb2\uff0c\u6743\u9650\u7684\u6548\u80fd\u4e3a\uff1a\u4e00\u4e2a\u6587\u4ef6\u80fd\u5426\u88ab\u6267\u884c\u4e0e\u5b83\u524d\u9762\u768410\u4e2a\u5c5e\u6027\u6709\u5173\u3002\u80fd\u5426\u6267\u884c\u6210\u529f\u5fc5\u987b\u8981\u770b\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\uff0c\u770b\u662f\u5426\u6709\u53ef\u6267\u884c\u7684\u6570\u636e\u3002\u6570\u5b57\u7c7b\u578b\u6539\u53d8\u6587\u4ef6\u6743\u9650\u7528\u6570\u5b57\u4ee3\u8868\u5404\u4e2a\u6743\u9650\uff0c\u5404\u6743\u9650\u7684\u5206\u6570\u5bf9\u7167\u5982\u4e0b\uff1a\u7b26\u53f7\u7c7b\u578b\u6539\u53d8\u6587\u4ef6\u6743\u9650<\/p>\n","protected":false},"author":1,"featured_media":269051,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-269050","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\/269050","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=269050"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/269050\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/269051"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=269050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=269050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=269050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}