{"id":6797,"date":"2024-07-28T10:01:01","date_gmt":"2024-07-28T02:01:01","guid":{"rendered":""},"modified":"2024-07-28T10:01:01","modified_gmt":"2024-07-28T02:01:01","slug":"linux\u6587\u4ef6\u6743\u9650\u8f6c\u6362,\u79d1\u5b66\u7f51\u2014[\u8f6c\u8f7d]Linux\u7528\u6237\u3001\u6587\u4ef6\u7684\u6743\u9650\u53ca\u4fee\u6539\u65b9\u6cd5 - \u6768\u5bb6\u4e50\u7684\u535a\u6587...","status":"publish","type":"post","link":"https:\/\/mushiming.com\/6797.html","title":{"rendered":"linux\u6587\u4ef6\u6743\u9650\u8f6c\u6362,\u79d1\u5b66\u7f51\u2014[\u8f6c\u8f7d]Linux\u7528\u6237\u3001\u6587\u4ef6\u7684\u6743\u9650\u53ca\u4fee\u6539\u65b9\u6cd5 - \u6768\u5bb6\u4e50\u7684\u535a\u6587..."},"content":{"rendered":"
1.Linux \u6587\u4ef6\u6743\u9650\u4ecb\u7ecd<\/p>\n
Lnux \u5185\u7684\u4e00\u5207\u7686\u6587\u4ef6\uff0c\u6240\u4ee5\u5bf9\u4e8e Linux \u4e0b\u6587\u4ef6\u7684\u7ba1\u7406\u5c31\u5341\u5206\u7684\u91cd\u8981\u4e86\u3002Linux \u4e0b\u7684\u6587\u4ef6\u6743\u9650\u5206\u4e3a\u4e09\u79cd\uff1ar(\u8bfb)\uff0cw(\u5199)\uff0cx(\u6267\u884c)\u3002Ubuntu \u4e0b\u67e5\u770b\u6743\u9650\u7684\u547d\u4ee4\u4e3a\uff1a$ ls -l filename # \u6587\u4ef6\u6743\u9650\u67e5\u8be2\uff0cfilename \u7528\u4e8e\u6307\u5b9a\u5177\u4f53\u6587\u4ef6<\/p>\n
$ ls -ld folder # \u6587\u4ef6\u5939\u6743\u9650\u67e5\u8be2\uff0cfolder \u7528\u4e8e\u6307\u5b9a\u5177\u4f53\u6587\u4ef6\u5939<\/p>\n
$ ll # \u67e5\u770b\u76ee\u5f55\u4e0b\u6240\u6709\u5185\u5bb9\u6743\u9650\u60c5\u51b5\uff0c\u4e5f\u53ef\u5728\u540e\u9762\u6307\u5b9a\u76ee\u5f55<\/p>\n
\u5982\u5217\u51fa\u7528\u6237\u6839\u76ee\u5f55\u4e0b\u6587\u4ef6\u7684\u6743\u9650\u60c5\u51b5\uff0c\u7ed3\u679c\u5982\u4e0b\uff1aspacefan@U1604:~$ ll<\/p>\n
\u603b\u7528\u91cf 152<\/p>\n
drwxr-xr-x 18 spacefan spacefan 4096 6\u6708 23 18:58 .\/<\/p>\n
drwxr-xr-x 3 root root 4096 6\u6708 12 05:51 ..\/<\/p>\n
-rw------- 1 spacefan spacefan 1490 6\u6708 23 18:57 .bash_history<\/p>\n
-rw-r--r-- 1 spacefan spacefan 220 6\u6708 12 05:51 .bash_logout<\/p>\n
-rw-r--r-- 1 spacefan spacefan 3771 6\u6708 12 05:51 .bashrc<\/p>\n
drwxrwxrwx 4 spacefan spacefan 4096 6\u6708 10 23:05 Bernesev5.2\/<\/p>\n
drwx------ 14 spacefan spacefan 4096 6\u6708 23 18:54 .cache\/<\/p>\n
drwx------ 3 spacefan spacefan 4096 6\u6708 23 11:22 .compiz\/<\/p>\n
drwx------ 19 spacefan spacefan 4096 6\u6708 23 14:32 .config\/<\/p>\n
drwx------ 3 spacefan spacefan 4096 6\u6708 12 05:56 .dbus\/<\/p>\n
drwxr-xr-x 2 spacefan spacefan 4096 6\u6708 12 05:56 Desktop\/<\/p>\n
-rw-r--r-- 1 spacefan spacefan 25 6\u6708 23 12:09 .dmrc<\/p>\n
drwxr-xr-x 2 spacefan spacefan 4096 6\u6708 12 05:56 Doc\/<\/p>\n
drwxr-xr-x 2 spacefan spacefan 4096 6\u6708 12 05:56 Download\/<\/p>\n
drwx------ 2 spacefan spacefan 4096 6\u6708 23 16:22 .gconf\/<\/p>\n
drwx------ 3 spacefan spacefan 4096 6\u6708 23 16:21 .gnupg\/<\/p>\n
-rw------- 1 spacefan spacefan 3140 6\u6708 23 16:22 .ICEauthority<\/p>\n
drwxr-xr-x 2 spacefan spacefan 4096 6\u6708 12 05:56 Image\/<\/p>\n
drwx------ 3 spacefan spacefan 4096 6\u6708 12 05:56 .local\/<\/p>\n
drwx------ 5 spacefan spacefan 4096 6\u6708 12 06:01 .mozilla\/<\/p>\n
drwxr-xr-x 2 spacefan spacefan 4096 6\u6708 12 05:56 Music\/<\/p>\n
drwx------ 2 spacefan spacefan 4096 6\u6708 12 05:56 .presage\/<\/p>\n
-rw-r--r-- 1 spacefan spacefan 655 6\u6708 12 05:51 .profile<\/p>\n
-rw-r--r-- 1 spacefan spacefan 0 6\u6708 12 06:00 .sudo_as_admin_successful<\/p>\n
drwxr-xr-x 2 spacefan spacefan 4096 6\u6708 12 05:56 Video\/<\/p>\n
-rw------- 1 spacefan spacefan 1503 6\u6708 23 18:24 .viminfo<\/p>\n
-rw------- 1 spacefan spacefan 150 6\u6708 23 16:21 .Xauthority<\/p>\n
-rw------- 1 spacefan spacefan 84 6\u6708 23 16:21 .xsession-errors<\/p>\n
-rw------- 1 spacefan spacefan 1172 6\u6708 23 14:34 .xsession-errors.old<\/p>\n
-rw-rw-r-- 1 spacefan spacefan 39425 6\u6708 22 23:35 .zcompdump<\/p>\n
\u53ef\u89c1\u6743\u9650\u8868\u793a\u4e00\u5171\u6709 10 \u4f4d\u5b57\u7b26\uff0c\u5176\u4e2d\uff1a\u7b2c 1 \u4f4d\u5b57\u7b26\u4ee3\u8868\u6863\u6848\u7c7b\u578b<\/p>\n
- \u4ee3\u8868\u6587\u4ef6<\/p>\n
d \u4ee3\u8868\u662f\u76ee\u5f55<\/p>\n
l \u4ee3\u8868\u94fe\u63a5<\/p>\n
\u7b2c 2~4 \u4f4d\u5b57\u7b26\u8868\u793a\u62e5\u6709\u8005(user)\u6743\u9650<\/p>\n
\u7b2c 2 \u4f4d\u5b57\u7b26\u4ee3\u8868\u62e5\u6709\u8005\u662f\u5426\u6709 \u8bfb \u6743\u9650<\/p>\n
\u7b2c 3 \u4f4d\u5b57\u7b26\u4ee3\u8868\u62e5\u6709\u8005\u662f\u5426\u6709 \u5199 \u6743\u9650<\/p>\n
\u7b2c 4 \u4f4d\u5b57\u7b26\u4ee3\u8868\u62e5\u6709\u8005\u662f\u5426\u6709 \u6267\u884c \u6743\u9650<\/p>\n
\u7b2c 5~7 \u4f4d\u5b57\u7b26\u8868\u793a\u540c\u7ec4\u8005(group)\u6743\u9650<\/p>\n
\u7b2c 5 \u4f4d\u5b57\u7b26\u4ee3\u8868\u540c\u7ec4\u8005(group)\u662f\u5426\u6709 \u8bfb \u6743\u9650<\/p>\n
\u7b2c 6 \u4f4d\u5b57\u7b26\u4ee3\u8868\u540c\u7ec4\u8005(group)\u662f\u5426\u6709 \u5199 \u6743\u9650<\/p>\n
\u7b2c 7 \u4f4d\u5b57\u7b26\u4ee3\u8868\u540c\u7ec4\u8005(group)\u662f\u5426\u6709 \u6267\u884c \u6743\u9650<\/p>\n
\u7b2c 8~10 \u4f4d\u5b57\u7b26\u8868\u793a\u5176\u4ed6\u7528\u6237(other)\u6743\u9650<\/p>\n
\u7b2c 8 \u4f4d\u5b57\u7b26\u4ee3\u8868\u5176\u4ed6\u7528\u6237(other)\u662f\u5426\u6709 \u8bfb \u6743\u9650<\/p>\n
\u7b2c 9 \u4f4d\u5b57\u7b26\u4ee3\u8868\u5176\u4ed6\u7528\u6237(other)\u662f\u5426\u6709 \u5199 \u6743\u9650<\/p>\n
\u7b2c 10 \u4f4d\u5b57\u7b26\u4ee3\u8868\u5176\u4ed6\u7528\u6237(other)\u662f\u5426\u6709 \u6267\u884c \u6743\u9650<\/p>\n
\u5176\u4e2d\uff0cr \u8868\u793a\u6587\u4ef6\u53ef\u4ee5\u88ab\u8bfb(read)\uff0cw \u8868\u793a\u6587\u4ef6\u53ef\u4ee5\u88ab\u5199(write)\uff0cx \u8868\u793a\u6587\u4ef6\u53ef\u4ee5\u88ab\u6267\u884c(\u5982\u679c\u5b83\u662f\u53ef\u6267\u884c\u7a0b\u5e8f\u7684\u8bdd)\uff0c- \u8868\u793a\u672a\u88ab\u6388\u4e88\u6743\u9650\u3002<\/p>\n
2 \u6743\u9650\u4fee\u6539\u65b9\u6cd5<\/p>\n
Linux \u7528 chmod \u547d\u4ee4\u4fee\u6539\u7528\u6237\u6743\u9650\uff0c\u5176\u7528\u6cd5\u5927\u81f4\u5206\u4e3a\u4e24\u79cd\uff0c1)\u6307\u5b9a\u67d0\u7c7b\u7528\u6237\u7684\u6743\u9650\uff1b2)\u540c\u65f6\u6307\u5b9a\u4e09\u7c7b\u7528\u6237\u7684\u6743\u9650\uff0c\u8bed\u6cd5\u4e3a\uff1achmod [-\u53ef\u9009\u53c2\u6570][+\/-\/=] \u6587\u4ef6\/\u76ee\u5f55\u53ef\u9009\u53c2\u6570\u5217\u8868<\/p>\n
-c\uff1a\u5f53\u53d1\u751f\u6539\u53d8\u65f6\u62a5\u544a\u5904\u7406\u4fe1\u606f<\/p>\n
-f\uff1a\u9519\u8bef\u4fe1\u606f\u4e0d\u8f93\u51fa<\/p>\n
-R\uff1a\u5904\u7406\u6307\u5b9a\u76ee\u5f55\u53ca\u5b50\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u6587\u4ef6<\/p>\n
-v\uff1a\u8fd0\u884c\u65f6\u663e\u793a\u8be6\u7ec6\u5904\u7406\u4fe1\u606f<\/p>\n
\u6307\u5b9a\u67d0\u7c7b\u7528\u6237\u7684\u6743\u9650<\/p>\n
shell chmod [u\/g\/o\/a] [+\/-\/=] [r\/w\/x] file[u \/ g \/ o \/ a] \u4e3a\u6743\u9650\u8303\u56f4\uff0c\u5176\u4e2d\uff1au\uff1aUser\uff0c\u5373\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u62e5\u6709\u8005<\/p>\n
g\uff1aGroup\uff0c\u5373\u6587\u4ef6\u6216\u76ee\u5f55\u7684\u6240\u5c5e\u7fa4\u7ec4<\/p>\n
o\uff1aOther\uff0c\u9664\u4e86\u6587\u4ef6\u6216\u76ee\u5f55\u62e5\u6709\u8005\u548c\u6240\u5c5e\u7fa4\u7ec4\u5916\uff0c\u5176\u4ed6\u7528\u6237\u90fd\u5c5e\u4e8e\u8fd9\u4e2a\u8303\u56f4<\/p>\n
a\uff1aAll\uff0c\u5373\u5168\u90e8\u7528\u6237<\/p>\n
\u6743\u9650\u64cd\u4f5c<\/p>\n
+\uff1a\u8868\u793a\u589e\u52a0\u6743\u9650<\/p>\n
-\uff1a\u8868\u793a\u53d6\u6d88\u6743\u9650<\/p>\n
=\uff1a\u8868\u793a\u53d6\u6d88\u4e4b\u524d\u7684\u6743\u9650\uff0c\u5e76\u7ed9\u4e88\u552f\u4e00\u7684\u6743\u9650<\/p>\n
\u6743\u9650\u4ee3\u53f7<\/p>\n
r\uff1a\u8bfb\u53d6\u6743\u9650\uff0c\u6570\u5b57\u4ee3\u53f7\u4e3a \u201c4\u201d<\/p>\n
w\uff1a\u5199\u5165\u6743\u9650\uff0c\u6570\u5b57\u4ee3\u53f7\u4e3a \u201c2\u201d<\/p>\n
x\uff1a\u6267\u884c\u6743\u9650\uff0c\u6570\u5b57\u4ee3\u53f7\u4e3a \u201c1\u201d<\/p>\n
-\uff1a\u4e0d\u5177\u5907\u4efb\u4f55\u6743\u9650\uff0c\u6570\u5b57\u4ee3\u53f7\u4e3a \u201c0\u201d<\/p>\n
file\uff1a\u6587\u4ef6\u540d(\u8def\u5f84)<\/p>\n
\u4f8b\u5982\u7ed9 User \u7528\u6237\u589e\u52a0\u4e86\u5bf9 code \u76ee\u5f55\u4e0b \/readme.txt \u6587\u4ef6 w \u548c x \u7684\u6743\u9650\uff1a<\/p>\n
shell $ sudo chmod u+rw code\/readme.txt\u540c\u65f6\u6307\u5b9a\u4e09\u7c7b\u7528\u6237\u7684\u6743\u9650<\/p>\n
shell chmod [xyz] file \u5176\u4e2d x\uff0cy\uff0cz \u5206\u522b\u6307\u5b9a User\u3001Group\u3001Other \u7684\u6743\u9650\uff1b\u7528\u4e09\u4f4d\u4e8c\u8fdb\u5236\u6570\u8868\u793a r , w , x \u4e09\u79cd\u6743\u9650(\u6ce8\u610f\u987a\u5e8f)\uff0c\u5176\u4e2d 0 \u4ee3\u8868\u6ca1\u6709\u8be5\u6743\u9650\uff0c1 \u4ee3\u8868\u6709\u8be5\u6743\u9650\uff0c\u5982 100 \u5219\u8868\u793a\uff0c\u6709 r \u6743\u9650\uff0c\u65e0 wx \u6743\u9650\uff1b\u518d\u5c06\u8fd9\u4e2a\u4e09\u4f4d\u7684\u4e8c\u8fdb\u5236\u6570\u8f6c\u4e3a\u5341\u8fdb\u5236\uff0c\u5219\u662f x(\u6216yz)\u7684\u503c\u3002User: 7 = 111\uff0c\u8868\u793a\u5177\u6709 rwx \u6743\u9650<\/p>\n
Group: 7 = 111\uff0c\u8868\u793a\u5177\u6709 rwx \u6743\u9650<\/p>\n
Other: 4 = 100\uff0c\u8868\u793a\u53ea\u5177\u6709 r \u6743\u9650\uff0c\u800c\u6ca1\u6709 wx \u6743\u9650<\/p>\n
\u4f8b\u5982\u7ed9 User \u548c Group \u201d\u8bfb+\u5199+\u6267\u884c\u201c \u7684\u6743\u9650(\u5373 rwx )\uff0c\u5e76\u7ed9 Other \u53ea \u201d\u8bfb\u201c(\u5373 r)\u7684\u6743\u9650\uff1a<\/p>\n
shell $ sudo chmod 774 code\/readme.txt<\/p>\n
\u5bf9\u5f53\u524d\u6240\u5728\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u975e\u9690\u85cf\u5185\u5bb9(Linux \u4e0b\u4ee5 . \u5f00\u5934\u7684\u4e3a\u9690\u85cf\u5185\u5bb9)\u505a\u6743\u9650\u4fee\u6539\u64cd\u4f5c\uff1a<\/p>\n
shell $ sudo chmod 774 * # \u201c*\u201d \u4e3a\u901a\u914d\u7b26\uff0c\u4ee3\u8868\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709\u975e\u9690\u85cf\u5185\u5bb9<\/p>\n
\u5bf9\u5f53\u524d\u6240\u5728\u76ee\u5f55\u4e0b\u7684\u6240\u6709\u5185\u5bb9(\u5305\u62ec\u4ee5 . \u5f00\u5934\u7684\u9690\u85cf\u5185\u5bb9)\u505a\u6743\u9650\u4fee\u6539\u64cd\u4f5c\uff1a<\/p>\n
shell $ sudo chmod 774 . # \u201c.\u201d \u4ee3\u8868\u5f53\u524d\u6240\u5728\u76ee\u5f55<\/p>\n
\u4fee\u6539\u6307\u5b9a\u76ee\u5f55\u4e0b\u6240\u6709\u5185\u5bb9(\u5305\u62ec\u4ee5 . \u5f00\u5934\u7684\u9690\u85cf\u5185\u5bb9)\u7684\u6743\u9650:<\/p>\n
shell $ sudo chmod -R 774 code\/<\/p>\n
\u2606\u6ce8\uff1a\u8f6c\u8f7d\u81ea Bernese 5.2 + Ubuntu 16.04 \u7f16\u8bd1\u5b89\u88c5\u5b8c\u5168\u6307\u5357 - Spacefan\u7684\u6587\u7ae0 - \u77e5\u4e4e<\/p>\n
https:\/\/zhuanlan.zhihu.com\/p\/<\/p>\n
\u8f6c\u8f7d\u672c\u6587\u8bf7\u8054\u7cfb\u539f\u4f5c\u8005\u83b7\u53d6\u6388\u6743\uff0c\u540c\u65f6\u8bf7\u6ce8\u660e\u672c\u6587\u6765\u81ea\u6768\u5bb6\u4e50\u79d1\u5b66\u7f51\u535a\u5ba2\u3002<\/p>\n
\u94fe\u63a5\u5730\u5740\uff1ahttp:\/\/blog.sciencenet.cn\/blog-3425554-1245634.html<\/p>\n
\u4e0a\u4e00\u7bc7\uff1aubuntu \u6587\u4ef6\u5220\u9664\u540e \u7a7a\u95f4\u6062\u590d<\/p>\n
\u4e0b\u4e00\u7bc7\uff1aBernese5.2 \u5b89\u88c5\u4e0eftp\u670d\u52a1\u5668\u66f4\u65b0<\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"linux\u6587\u4ef6\u6743\u9650\u8f6c\u6362,\u79d1\u5b66\u7f51\u2014[\u8f6c\u8f7d]Linux\u7528\u6237\u3001\u6587\u4ef6\u7684\u6743\u9650\u53ca\u4fee\u6539\u65b9\u6cd5 - \u6768\u5bb6\u4e50\u7684\u535a\u6587...1.Linux\u6587\u4ef6\u6743\u9650\u4ecb\u7ecdLnux\u5185\u7684\u4e00\u5207\u7686\u6587\u4ef6...","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"_links":{"self":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6797"}],"collection":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/comments?post=6797"}],"version-history":[{"count":0,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/posts\/6797\/revisions"}],"wp:attachment":[{"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/media?parent=6797"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/categories?post=6797"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/mushiming.com\/wp-json\/wp\/v2\/tags?post=6797"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}