{"id":283434,"date":"2023-09-24T20:05:36","date_gmt":"2023-09-24T12:05:36","guid":{"rendered":"https:\/\/lrxjmw.cn\/lxtqxglzwyhq.html"},"modified":"2023-09-24T20:05:36","modified_gmt":"2023-09-24T12:05:36","slug":"lxtqxglzwyhq","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lxtqxglzwyhq.html","title":{"rendered":"Linux\u7cfb\u7edf\u6743\u9650\u7ba1\u7406\uff1a\u638c\u63e1\u7528\u6237\u6743\u76ca\uff0c\u52a9\u529b\u5b89\u5168\u8fd0\u7ef4"},"content":{"rendered":"

\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecdlinux\u7cfb\u7edf<\/a>\u4e2d\u7528\u6237\u6743\u9650\u7ba1\u7406\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5305\u62ec\u7528\u6237\u7684\u521b\u5efa\u4e0e\u5220\u9664\u3001\u7528\u6237\u7ec4\u7684\u7ba1\u7406\u3001\u6743\u9650\u7684\u5206\u914d\u4e0e\u4fee\u6539\u7b49\u3002\u901a\u8fc7\u672c\u6587\u7684\u6307\u5bfc\uff0c\u60a8\u53ef\u4ee5\u66f4\u597d\u5730\u638c\u63e1linux\u7cfb\u7edf\u4e2d\u7528\u6237\u6743\u9650\u7684\u7ba1\u7406\u65b9\u6cd5\u3002<\/p>\n

1.\u5982\u4f55\u521b\u5efa\u4e00\u4e2a\u65b0\u7528\u6237\uff1f<\/b><\/p>\n

\u5728linux\u7cfb\u7edf\u4e2d\u5982\u4f55\u5b89\u88c5LINUX\uff0c\u4f7f\u7528`useradd`\u547d\u4ee4<\/a>\u53ef\u4ee5\u521b\u5efa\u65b0\u7528\u6237\u3002\u4f8b\u5982\uff0c\u8981\u521b\u5efa\u4e00\u4e2a\u540d\u4e3a\"newuser\"\u7684\u7528\u6237\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nuseradd newuser\n<\/pre>\n<\/p>\n

\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\uff0c\u60a8\u5c31\u6210\u529f\u5730\u521b\u5efa\u4e86\u4e00\u4e2a\u65b0\u7528\u6237\u3002<\/p>\n

2.\u5982\u4f55\u5220\u9664\u4e00\u4e2a\u5df2\u6709\u7528\u6237\uff1f<\/b><\/p>\n

\u8981\u5220\u9664\u4e00\u4e2a\u5df2\u6709\u7684\u7528\u6237\uff0c\u53ef\u4ee5\u4f7f\u7528`userdel`\u547d\u4ee4\u3002\u4f8b\u5982\uff0c\u8981\u5220\u9664\u540d\u4e3a\"olduser\"\u7684\u7528\u6237\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nuserdel olduser\n<\/pre>\n<\/p>\n

\u8fd9\u6837\u5c31\u6210\u529f\u5730\u5c06\u8be5\u7528\u6237\u4ece\u7cfb\u7edf\u4e2d\u5220\u9664\u4e86\u3002<\/p>\n

3.\u5982\u4f55\u7ba1\u7406\u7528\u6237\u7ec4\uff1f<\/b><\/p>\n

\u5728linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528`groupadd`\u547d\u4ee4\u6765\u521b\u5efa\u65b0\u7684\u7528\u6237\u7ec4\uff0c\u4f8b\u5982\uff1a<\/p>\n

\n

\ngroupadd newgroup\n<\/pre>\n<\/p>\n

\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\uff0c\u60a8\u5c31\u6210\u529f\u5730\u521b\u5efa\u4e86\u4e00\u4e2a\u540d\u4e3a\"newgroup\"\u7684\u7528\u6237\u7ec4\u3002<\/p>\n

\u8981\u5c06\u5df2\u6709\u7528\u6237\u6dfb\u52a0\u5230\u67d0\u4e2a\u7528\u6237\u7ec4\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528`usermod`\u547d\u4ee4\u3002\u4f8b\u5982\uff0c\u8981\u5c06\u540d\u4e3a\"olduser\"\u7684\u7528\u6237\u6dfb\u52a0\u5230\"newgroup\"\u7528\u6237\u7ec4\u4e2d\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nusermod -aG newgroup olduser\n<\/pre>\n<\/p>\n

\u8fd9\u6837\u5c31\u6210\u529f\u5730\u5c06\u8be5\u7528\u6237\u6dfb\u52a0\u5230\u4e86\u6307\u5b9a\u7684\u7528\u6237\u7ec4\u4e2d\u3002<\/p>\n

4.\u5982\u4f55\u5206\u914d\u548c\u4fee\u6539\u7528\u6237\u6743\u9650\uff1f<\/b><\/p>\n

\u5728linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528`chmod`\u547d\u4ee4\u6765\u5206\u914d\u548c\u4fee\u6539\u6587\u4ef6\u7684\u6743\u9650\u3002\u4f8b\u5982\uff0c\u8981\u5c06\u67d0\u4e2a\u6587\u4ef6\u7684\u6240\u6709\u8005\u6743\u9650\u8bbe\u7f6e\u4e3a\u53ef\u8bfb\u5199\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nchmod u+rw filename\n<\/pre>\n<\/p>\n

\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4linux\u7cfb\u7edf\u7528\u6237\u6743\u9650\u7ba1\u7406<\/strong>\uff0c\u60a8\u5c31\u6210\u529f\u5730\u5c06\u8be5\u6587\u4ef6\u7684\u6240\u6709\u8005\u6743\u9650\u8bbe\u7f6e\u4e3a\u53ef\u8bfb\u5199\u3002<\/p>\n

5.\u5982\u4f55\u67e5\u770b\u7528\u6237\u7684\u6743\u9650\u4fe1\u606f\uff1f<\/b><\/p>\n

\u8981\u67e5\u770b\u7528\u6237\u7684\u6743\u9650\u4fe1\u606f\uff0c\u53ef\u4ee5\u4f7f\u7528`ls -l`\u547d\u4ee4\u3002\u4f8b\u5982\uff0c\u8981\u67e5\u770b\u5f53\u524d\u76ee\u5f55\u4e0b\u6240\u6709\u6587\u4ef6\u7684\u8be6\u7ec6\u6743\u9650\u4fe1\u606f\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nls -l\n<\/pre>\n<\/p>\n

\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\uff0c\u60a8\u5c31\u53ef\u4ee5\u67e5\u770b\u5230\u6bcf\u4e2a\u6587\u4ef6\u7684\u6240\u6709\u8005\u3001\u6240\u5c5e\u7528\u6237\u7ec4\u4ee5\u53ca\u6743\u9650\u7b49\u4fe1\u606f\u3002<\/p>\n

6.\u5982\u4f55\u9650\u5236\u7528\u6237\u5bf9\u67d0\u4e2a\u6587\u4ef6\u7684\u8bbf\u95ee\uff1f<\/b><\/p>\n

\u5728linux\u7cfb\u7edf\u4e2d\u7ea2\u65d7linux6.0\uff0c\u53ef\u4ee5\u4f7f\u7528`chown`\u547d\u4ee4\u6765\u66f4\u6539\u6587\u4ef6\u7684\u6240\u6709\u8005\u548c\u6240\u5c5e\u7528\u6237\u7ec4\u3002\u4f8b\u5982linux\u7cfb\u7edf\u7528\u6237\u6743\u9650\u7ba1\u7406<\/strong>\uff0c\u8981\u5c06\u67d0\u4e2a\u6587\u4ef6\u7684\u6240\u6709\u8005\u66f4\u6539\u4e3a\"newuser\"\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nchown newuser filename\n<\/pre>\n<\/p>\n

\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\uff0c\u60a8\u5c31\u6210\u529f\u5730\u5c06\u8be5\u6587\u4ef6\u7684\u6240\u6709\u8005\u66f4\u6539\u4e3a\u4e86\u6307\u5b9a\u7528\u6237\u3002<\/p>\n

linux\u6743\u9650\u7ba1\u7406\u547d\u4ee4\u600e\u4e48\u7528_linux\u7cfb\u7edf\u7528\u6237\u6743\u9650\u7ba1\u7406_linux\u7528\u6237\u7ba1\u7406\u548c\u6743\u9650\u7ba1\u7406<\/p>\n

7.\u5982\u4f55\u7981\u6b62\u67d0\u4e2a\u7528\u6237\u767b\u5f55\u7cfb\u7edf\uff1f<\/b><\/p>\n

\u8981\u7981\u6b62\u67d0\u4e2a\u7528\u6237\u767b\u5f55\u7cfb\u7edf\uff0c\u53ef\u4ee5\u4f7f\u7528`usermod`\u547d\u4ee4\u3002\u4f8b\u5982\uff0c\u8981\u7981\u6b62\u540d\u4e3a\"baduser\"\u7684\u7528\u6237\u767b\u5f55\u7cfb\u7edf\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nusermod -L baduser\n<\/pre>\n<\/p>\n

\u8fd9\u6837\u5c31\u6210\u529f\u5730\u7981\u6b62\u4e86\u8be5\u7528\u6237\u7684\u767b\u5f55\u3002<\/p>\n

8.\u5982\u4f55\u9650\u5236\u67d0\u4e2a\u7528\u6237\u53ea\u80fd\u8bbf\u95ee\u7279\u5b9a\u76ee\u5f55\uff1f<\/b><\/p>\n

\u5728linux\u7cfb\u7edf\u4e2d\uff0c\u53ef\u4ee5\u4f7f\u7528`chroot`\u547d\u4ee4\u6765\u9650\u5236\u67d0\u4e2a\u7528\u6237\u53ea\u80fd\u8bbf\u95ee\u7279\u5b9a\u7684\u76ee\u5f55\u3002\u4f8b\u5982\uff0c\u8981\u5c06\u540d\u4e3a\"specialuser\"\u7684\u7528\u6237\u9650\u5236\u5728\"\/home\/special\"\u76ee\u5f55\u4e0b\uff0c\u53ef\u4ee5\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\uff1a<\/p>\n

\n

\nchroot \/home\/special specialuser\n<\/pre>\n<\/p>\n

\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\uff0c\u60a8\u5c31\u6210\u529f\u5730\u5c06\u8be5\u7528\u6237\u9650\u5236\u5728\u4e86\u6307\u5b9a\u76ee\u5f55\u4e0b\u3002<\/p>\n

9.\u5982\u4f55\u67e5\u770b\u5f53\u524d\u767b\u5f55\u7528\u6237\u7684\u4fe1\u606f\uff1f<\/b><\/p>\n

\u8981\u67e5\u770b\u5f53\u524d\u767b\u5f55\u7528\u6237\u7684\u4fe1\u606f\uff0c\u53ef\u4ee5\u4f7f\u7528`whoami`\u547d\u4ee4\u3002\u4f8b\u5982\uff0c\u8fd0\u884c\u4ee5\u4e0b\u547d\u4ee4\u5373\u53ef\u67e5\u770b\u5f53\u524d\u767b\u5f55\u7528\u6237\u7684\u7528\u6237\u540d\uff1a<\/p>\n

\n

\nwhoami\n<\/pre>\n<\/p>\n

\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\uff0c\u60a8\u5c31\u53ef\u4ee5\u67e5\u770b\u5230\u5f53\u524d\u767b\u5f55\u7528\u6237\u7684\u7528\u6237\u540d\u3002<\/p>\n

\u4ee5\u4e0a\u5c31\u662f\u5173\u4e8elinux\u7cfb\u7edf\u7528\u6237\u6743\u9650\u7ba1\u7406<\/strong>\u7684\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u548c\u89e3\u7b54\u3002\u5e0c\u671b\u672c\u6587\u5bf9\u60a8\u6709\u6240\u5e2e\u52a9\uff01\u5982\u679c\u60a8\u8fd8\u6709\u5176\u4ed6\u95ee\u9898\uff0c\u8bf7\u968f\u65f6\u63d0\u95ee\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u672c\u6587\u5c06\u4e3a\u5927\u5bb6\u4ecb\u7ecdlinux\u7cfb\u7edf\u4e2d\u7528\u6237\u6743\u9650\u7ba1\u7406\u7684\u76f8\u5173\u77e5\u8bc6\uff0c\u5305\u62ec\u7528\u6237\u7684\u521b\u5efa\u4e0e\u5220\u9664\u3001\u7528\u6237\u7ec4\u7684\u7ba1\u7406\u3001\u6743\u9650\u7684\u5206\u914d\u4e0e\u4fee\u6539\u7b49\u3002\u901a\u8fc7\u672c\u6587\u7684\u6307\u5bfc\uff0c\u60a8\u53ef\u4ee5\u66f4\u597d\u5730\u638c\u63e1linux\u7cfb\u7edf\u4e2d\u7528\u6237\u6743\u9650\u7684\u7ba1\u7406\u65b9\u6cd5\u3002\u5982\u4f55\u5206\u914d\u548c\u4fee\u6539\u7528\u6237\u6743\u9650\uff1f\u5982\u4f55\u67e5\u770b\u7528\u6237\u7684\u6743\u9650\u4fe1\u606f\uff1f\u901a\u8fc7\u8fd9\u4e2a\u547d\u4ee4\uff0c\u60a8\u5c31\u53ef\u4ee5\u67e5\u770b\u5230\u6bcf\u4e2a\u6587\u4ef6\u7684\u6240\u6709\u8005\u3001\u6240\u5c5e\u7528\u6237\u7ec4\u4ee5\u53ca\u6743\u9650\u7b49\u4fe1\u606f\u3002\u4ee5\u4e0a\u5c31\u662f\u5173\u4e8elinux\u7cfb\u7edf\u7528\u6237\u6743\u9650\u7ba1\u7406\u7684\u4e00\u4e9b\u5e38\u89c1\u95ee\u9898\u548c\u89e3\u7b54\u3002<\/p>\n","protected":false},"author":1,"featured_media":283435,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-283434","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\/283434","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=283434"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/283434\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/283435"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=283434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=283434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=283434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}