{"id":284674,"date":"2023-10-06T20:06:43","date_gmt":"2023-10-06T12:06:43","guid":{"rendered":"https:\/\/lrxjmw.cn\/lnhsyilsbzcy.html"},"modified":"2023-10-06T20:06:43","modified_gmt":"2023-10-06T12:06:43","slug":"lnhsyilsbzcy","status":"publish","type":"post","link":"https:\/\/lrxjmw.cn\/lnhsyilsbzcy.html","title":{"rendered":"Linux\u5185\u6838\u4f7f\u7528ID\u6765\u8bc6\u522b\u7ec4\u6210\u5458\u7528\u6237\u7ec4\u6269\u5c55\u77e5\u8bc6\u6c47\u603b"},"content":{"rendered":"

\u6587\u7ae0\u76ee\u5f55<\/p>\n

\u547d\u4ee4<\/a>\u7b80\u4ecb<\/p>\n

\u7528\u4e8e\u521b\u5efa\u4e00\u4e2a\u65b0\u7684\u5de5\u4f5c\u7ec4\uff0c\u65b0\u5de5\u4f5c\u7ec4\u7684\u4fe1\u606f\u5c06\u88ab\u6dfb\u52a0\u5230\/etc\/group\u6587\u4ef6\u4e2d\u3002<\/p>\n

\/etc\/group\u6587\u4ef6\u50a8\u5b58\u7740\u7cfb\u7edf<\/a>\u6240\u6709\u7684\u7528\u6237\u7ec4\u4fe1\u606flinux\u521b\u5efa\u7528\u6237\u7ec4\u548c\u7528\u6237<\/strong>\uff0c\u6587\u4ef6\u4e2d\u6bcf\u4e00\u884c\u63cf\u8ff0\u4e00\u4e2a\u7528\u6237\u7ec4\u4fe1\u606f\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

\n

\u7ec4\u540d\u79f0\uff1a\u7ec4\u5bc6\u7801\uff1a\u7ec4ID\uff1a\u7ec4\u6210\u5458\n<\/code><\/pre>\n<\/p>\n

\u7ec4\u540d\u79f0\uff1a\u6bcf\u4f4d\u7ec4\u90fd\u6709\u4e00\u4e2a\u7ec4\u540d\u79f0<\/p>\n

\u7ec4\u5bc6\u7801\uff1a\u53ef\u4ee5\u7ed9\u7ec4\u63d0\u4f9b\u4e00\u4e2a\u5bc6\u7801\uff0c\u901a\u5e38\u6781\u5c11\u5982\u6b64\u505a<\/p>\n

\u7ec4ID\uff1a\u50cf\u7528\u6237ID\u4e00\u6837\uff0cLinux<\/a>\u5185\u6838\u4f7f\u7528ID\u6765\u8fa8\u8bc6<\/p>\n

\u7ec4\u6210\u5458\uff1a\u5b9a\u4e49\u7ec4\u6210\u5458\u7528\u6237\u540d\u5217\u8868\uff0c\u7528\u5168\u89d2\u5192\u53f7\u9694\u5f00<\/p>\n

\u67e5\u770b\u8be5\u6587\u4ef6\u7684\u5185\u5bb9\uff1a<\/p>\n

\n

[<\/span>root@htlwk0001host cron]<\/span># cat \/etc\/group<\/span>\nroot:x:0:\nbin:x:1:\ndaemon:x:2:\nsys:x:3:\nadm:x:4:\ntty:x:5:\ndisk:x:6:\nlp:x:7:\n<\/code><\/pre>\n<\/p>\n

\u6ce8\uff1a<\/p>\n

1.\u6211\u4eec\u770b\u89c1\u6240\u6709\u7684\u7528\u6237\u7ec4\u7684\u6210\u5458\u90fd\u662f\u7a7a\u7684\uff0c\u8bf4\u660e\u8fd9\u4e2a\u7ec4\u7684\u6210\u5458\u53ea\u6709\u4e00\u4e2a\uff0c\u5c31\u662f\u540d\u79f0\u4e0e\u7528\u6237id\u90fd\u548c\u8fd9\u4e2a\u7ec4\u76f8\u540c\u7684\u7528\u6237linux\u8fd0\u7ef4\u9762\u8bd5\u9898\uff0c\u5176\u5b9e\u8fd9\u4e2a\u7ec4\u662f\u7531\u4e8e\u521b\u5efa\u4e86\u67d0\u4e2a\u7528\u6237\u800c\u9ed8\u8ba4\u521b\u5efa\u540c\u540d\u4e14\u540cid\u53f7\u7684\u7528\u6237\u7ec4\u3002<\/p>\n

2.\u6bcf\u4f4d\u7528\u6237\u90fd\u5f52\u5c5e\u4e00\u4e2a\u57fa\u672c\u7528\u6237\u7ec4\uff0c\u5728\u6587\u4ef6\/etc\/passwd\u4e2d\u5b9a\u4e49<\/p>\n

\u7528\u6237\u53ef\u4ee5\u52a0\u5165\u591a\u4e2a\u6b21\u8981\u7ec4\uff1a<\/p>\n

linux\u521b\u5efa\u7528\u6237\u548c\u7ec4\u5e76\u8d4b\u6743_\u521b\u5efa\u7528\u6237\u7ec4linux_linux\u521b\u5efa\u7528\u6237\u7ec4\u548c\u7528\u6237<\/p>\n

\n

     root:x:0:root\n     bin:x:1:root,bin,daemon\n     daemon:x:2:root,bin,daemon\n     sys:x:3:root,bin,adm\n     adm:x:4:root,adm,daemon\n     disk:x:6:root\n     wheel:x:10:root\n<\/code><\/pre>\n<\/p>\n

\u53ef\u4ee5\u770b\u89c1linux\u521b\u5efa\u7528\u6237\u7ec4\u548c\u7528\u6237<\/strong>\uff0c\u7528\u6237root\uff0cbin\uff0cdaemon\u90fd\u5c5e\u4e8e\u591a\u4e2a\u7528\u6237\u7ec4\u3002<\/p>\n

\u5e38\u7528\u9009\u9879\u9009\u9879\u8bf4\u660e<\/p>\n

-g<\/p>\n

\u6307\u5b9a\u65b0\u5efa\u5de5\u4f5c\u7ec4\u7684id<\/p>\n

-r<\/p>\n

\u521b\u5efa\u7cfb\u7edf\u5de5\u4f5c\u7ec4\uff0c\u7cfb\u7edf\u5de5\u4f5c\u7ec4\u7684\u7ec4ID\u5927\u4e8e500<\/p>\n

-K<\/p>\n

\u8986\u76d6\u914d\u7f6e\u6587\u4ef6\u201c\/ect\/login.defs\u201d<\/p>\n

-o<\/p>\n

\u51c6\u8bb8\u6dfb\u52a0\u7ec4ID\u53f7\u4e0d\u60df\u4e00\u7684\u5de5\u4f5c\u7ec4<\/p>\n

-f<\/p>\n

\u867d\u7136\u7ec4\u7fa4\u65e9\u5df2\u5b58\u5728\uff0c\u8fd8\u662f\u5f3a\u5236\u521b\u5efa\u7ec4\u7fa4<\/p>\n

-p<\/p>\n

linux\u521b\u5efa\u7528\u6237\u548c\u7ec4\u5e76\u8d4b\u6743_linux\u521b\u5efa\u7528\u6237\u7ec4\u548c\u7528\u6237_\u521b\u5efa\u7528\u6237\u7ec4linux<\/p>\n

\u4e3a\u65b0\u7ec4\u7fa4\u8bbe\u7f6e\u52a0\u5bc6\u7684\u5bc6\u7801<\/p>\n

\u53c2\u8003\u793a\u4f8b\u521b\u5efa\u65b0\u7684\u7528\u6237\u7ec4<\/p>\n

\u521b\u5efa\u7528\u6237\u7ec4linuxcool\uff0c\u5e76\u6307\u5b9a\u7528\u6237\u7ec4id\u4e3a1005\uff0c\u547d\u4ee4\u5982\u4e0b\uff1a<\/p>\n

\n

[<\/span>root@linuxcool ~]<\/span># groupadd -g 1005 linuxcool<\/span>\n<\/code><\/pre>\n<\/p>\n

\u521b\u5efa\u7cfb\u7edf\u7528\u6237\u7ec4<\/p>\n

\n

[<\/span>root@linuxcool ~]<\/span># groupadd -r -g 368 linuxcool<\/span>\n<\/code><\/pre>\n<\/p>\n

\u6269\u5145\u77e5\u8bc6<\/p>\n

1.\u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684\u6bcf\u4f4d\u6587\u4ef6\u6709\u4e00\u4e2a\u7528\u6237\u6240\u6709\u8005\u548c\u4e00\u4e2a\u7ec4\u6240\u6709\u8005\u3002<\/p>\n

2.\u600e\u6837\u5728linux\u4e2d\u67e5\u8be2\u4e00\u4e2a\u7ec4\u6709\u4ec0\u4e48\u7528\u6237\uff1f<\/p>\n

\u6267\u884c\u4e0b\u8fb9\u7684\u547d\u4ee4\uff1a<\/p>\n

\n

cat<\/span> \/etc\/group |<\/span> grep<\/span> groupname\n<\/code><\/pre>\n<\/p>\n

\u5047\u5982\u5b58\u5728\u8fd9\u4e2a\u7528\u6237\u7ec4\uff0c\u4f60\u4f1a\u770b\u89c1\u4e00\u6761\u8bb0\u5f55linux\u64cd\u4f5c\u7cfb\u7edf\uff0c\u4e4b\u540e\u67e5\u770b\u5176\u6700\u540e\u4e00\u4e2a\u6570\u7ec4\u5373\u53ef\u3002<\/p>\n

3.\u600e\u6837\u5728linux\u4e2d\u67e5\u8be2\u4e00\u4e2a\u7528\u6237\u5c5e\u4e8e\u4ec0\u4e48\u7ec4\uff1f<\/p>\n

\u6267\u884c\u4e0b\u8fb9\u7684\u547d\u4ee4\uff1a<\/p>\n

\n

cat<\/span> \/etc\/group |<\/span> grep<\/span> username \n<\/code><\/pre>\n<\/p>\n

\u5047\u5982\u53ea\u6709\u4e00\u6761\u8bb0\u5f55\uff0c\u8bf4\u660e\u7528\u6237\u53ea\u5c5e\u4e8e\u4e00\u4e2a\u7ec4\uff0c\u591a\u6761\u5219\u8bf4\u660e\u7528\u6237\u5c5e\u4e8e\u591a\u4e2a\u7ec4\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"

\u6587\u4ef6\u5b58\u50a8\u7740\u7cfb\u7edf\u6240\u6709\u7684\u7528\u6237\u7ec4\u4fe1\u606f\uff0c\u6587\u4ef6\u4e2d\u6bcf\u4e00\u884c\u63cf\u8ff0\u4e00\u4e2a\u7528\u6237\u7ec4\u4fe1\u606f\uff0c\u683c\u5f0f\u5982\u4e0b\uff1a\u6307\u5b9a\u65b0\u5efa\u5de5\u4f5c\u7ec4\u7684id\u521b\u5efa\u7cfb\u7edf\u5de5\u4f5c\u7ec4\uff0c\u7cfb\u7edf\u5de5\u4f5c\u7ec4\u7684\u7ec4ID\u5c0f\u4e8e500\u5373\u4f7f\u7ec4\u7fa4\u5df2\u7ecf\u5b58\u5728\uff0c\u8fd8\u662f\u5f3a\u5236\u521b\u5efa\u7ec4\u7fa4\u4e3a\u65b0\u7ec4\u7fa4\u8bbe\u7f6e\u52a0\u5bc6\u7684\u5bc6\u7801\u521b\u5efa\u7cfb\u7edf\u7528\u6237\u7ec4\u6587\u4ef6\u7cfb\u7edf\u4e0a\u7684\u6bcf\u4e2a\u6587\u4ef6\u6709\u4e00\u4e2a\u7528\u6237\u6240\u6709\u8005\u548c\u4e00\u4e2a\u7ec4\u6240\u6709\u8005\u3002\u5982\u4f55\u5728linux\u4e2d\u67e5\u8be2\u4e00\u4e2a\u7ec4\u6709\u54ea\u4e9b\u7528\u6237\uff1f\u5982\u4f55\u5728linux\u4e2d\u67e5\u8be2\u4e00\u4e2a\u7528\u6237\u5c5e\u4e8e\u54ea\u4e9b\u7ec4\uff1f<\/p>\n","protected":false},"author":1,"featured_media":284675,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[988],"tags":[999],"class_list":["post-284674","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\/284674","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=284674"}],"version-history":[{"count":0,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/posts\/284674\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media\/284675"}],"wp:attachment":[{"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/media?parent=284674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/categories?post=284674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lrxjmw.cn\/wp-json\/wp\/v2\/tags?post=284674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}