{"id":438628,"date":"2021-04-15T07:01:04","date_gmt":"2021-04-14T23:01:04","guid":{"rendered":"http:\/\/4563.org\/?p=438628"},"modified":"2021-04-15T07:01:04","modified_gmt":"2021-04-14T23:01:04","slug":"%e9%97%ae%e4%b8%aa-linux-%e9%97%ae%e9%a2%98%ef%bc%8c%e7%ba%a0%e7%bb%93%e4%b8%80%e4%b8%8b%e5%8d%88%e4%ba%86%ef%bc%8c%e5%85%b3%e4%ba%8e-user-%e5%92%8c-group-etc-passwd-%e5%92%8c-etc-group","status":"publish","type":"post","link":"http:\/\/4563.org\/?p=438628","title":{"rendered":"\u95ee\u4e2a Linux \u95ee\u9898\uff0c\u7ea0\u7ed3\u4e00\u4e0b\u5348\u4e86\uff0c\u5173\u4e8e user \u548c group, \/etc\/passwd \u548c \/etc\/group"},"content":{"rendered":"<div>\n<div>\n<div>\n<h1>                  \u95ee\u4e2a Linux \u95ee\u9898\uff0c\u7ea0\u7ed3\u4e00\u4e0b\u5348\u4e86\uff0c\u5173\u4e8e user \u548c group, \/etc\/passwd \u548c \/etc\/group               <\/h1>\n<p> <\/p>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : AllenHua <\/span>  <span><i><\/i> 0<\/span> <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<\/p><\/div>\n<div isfirst=\"1\"> <\/p>\n<p>\/etc\/passwd \u548c \/etc\/group \u6587\u4ef6\u8be6\u89e3 https:\/\/www.cnblogs.com\/zx3212\/p\/9141381.html<\/p>\n<p>\/etc\/group \u7684\u82f1\u6587\u539f\u7248\u89e3\u91ca\uff1a<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/04\/20210419_607d4ffe1fedd.png\" alt=\"\u95ee\u4e2a Linux \u95ee\u9898\uff0c\u7ea0\u7ed3\u4e00\u4e0b\u5348\u4e86\uff0c\u5173\u4e8e user \u548c group, \/etc\/passwd \u548c \/etc\/group\" \/><\/p>\n<p>\u5176\u4e2d\u7ea0\u7ed3\u7684\u70b9\u5728\u4e8e <strong>\/etc\/group<\/strong> \u7684\u7b2c\u56db\u4e2a\u5b57\u6bb5\uff0c\u8fd9\u4e2a\u5b57\u6bb5\u662f\u5c5e\u4e8e\u8be5\u7ec4\u6210\u5458\u7684\u7528\u6237\u540d\u5217\u8868\uff0c\u4ee5\u9017\u53f7\u5206\u9694\u7684<\/p>\n<p>\u4f7f\u7528\u547d\u4ee4\u521b\u5efa\u4e00\u4e2a user\uff0c\u5e76\u6307\u5b9a\u5b83\u7684\u5bb6\u76ee\u5f55\uff0c\u6307\u5b9a\u4ed6\u7684\u4e3b\u7ec4\uff08 primary group \uff09\uff0c\u8fd8\u6307\u5b9a\u5b83\u7684 shell \u89e3\u91ca\u5668<\/p>\n<pre><code>useradd test2 -d \/home\/test2 -g testgroup -m -s \/bin\/bash <\/code><\/pre>\n<p>\u67e5\u770b \/etc\/passwd<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/04\/20210419_607d500110079.png\" alt=\"\u95ee\u4e2a Linux \u95ee\u9898\uff0c\u7ea0\u7ed3\u4e00\u4e0b\u5348\u4e86\uff0c\u5173\u4e8e user \u548c group, \/etc\/passwd \u548c \/etc\/group\" \/><\/p>\n<p>\u7528\u6237 test2 \u7684\u7ec4 id \u662f 6803<\/p>\n<p>\u63a5\u7740\u67e5\u770b \/etc\/group<\/p>\n<p><img decoding=\"async\" loading=\"lazy\" referrerpolicy=\"no-referrer\" rel=\"noreferrer\" src=\"http:\/\/4563.org\/wp-content\/uploads\/2021\/04\/20210419_607d50063e67e.png\" alt=\"\u95ee\u4e2a Linux \u95ee\u9898\uff0c\u7ea0\u7ed3\u4e00\u4e0b\u5348\u4e86\uff0c\u5173\u4e8e user \u548c group, \/etc\/passwd \u548c \/etc\/group\" \/><\/p>\n<p>\u7ec4 id 6803 \u7ec4\u540d\u7684\u786e\u662f testgroup\uff0c<strong>\u4f46\u662f\u95ee\u9898\u6765\u4e86\uff0c\u4e3a\u4ec0\u4e48\u7b2c\u56db\u4e2a\u5b57\u6bb5\u6ca1\u6709 test2 \u8fd9\u4e2a\u7528\u6237\uff1f\u4e0d\u662f\u8be5\u7ec4\u540d\u4e0b\u7684\u7528\u6237\u5217\u8868\u4e48\uff0c\u4e3a\u4ec0\u4e48\u662f\u7a7a\u7684\uff0c\u4e3a\u4ec0\u4e48\u6ca1\u6709 test2 \u8fd9\u4e2a\u7528\u6237<\/strong><\/p>\n<p>\u5173\u4e8e\u8fd9\u4e00\u70b9\uff0c\u4e3b\u548c\u670b\u53cb\u641c\u7d22\u4e86\u5927\u91cf\u8d44\u6599\uff0c\u5173\u4e8e Linux \u7684\u4e00\u4e2a user\uff0c\u5b83\u6709 primary group \uff08\u6709\u4e14\u4ec5\u6709\u4e00\u4e2a\u4e3b\u7ec4\uff09\uff0c\u8fd8\u6709 supplementary group \uff08\u8fd8\u6709\u8865\u5145\u7ec4\uff0c\u4e00\u4e2a user \u53ef\u4ee5\u5c5e\u4e8e\u591a\u4e2a\u8865\u5145\u7ec4\uff09<\/p>\n<p>The primary group is the main one shown in \/etc\/passwd<\/p>\n<p>The supplementary groups give access to resources, but any new files are created with primary group.<\/p>\n<p>\u73b0\u5728\u7b80\u8981\u8bf4\u660e\u4e00\u4e0b\uff0c\u4e3b\u8fd8\u662f\u4e0d\u592a\u660e\u767d\u4e3a\u4ec0\u4e48\u6211\u521a\u521a\u521b\u5efa <strong>test2<\/strong> \u8fd9\u4e2a user\uff0c\u5e76\u4e14\u6307\u5b9a\u4e86\u4ed6\u7684 primary group \u662f <strong>testgroup<\/strong> \u4f46\u662f\uff01\u4f46\u662f\uff01 \u4f46\u662f\u5728 <strong>\/etc\/group<\/strong> \u4e2d\u770b\u8fd9\u4e2a\u7ec4\u7684\u7528\u6237\u5217\u8868\u91cc\u5374\u6ca1\u6709 <strong>test2<\/strong><\/p>\n<p>\u5e0c\u671b\u6709\u4eba\u6765\u5e2e\u4e3b\u89e3\u60d1\uff0c\u611f\u6fc0\u4e07\u5206\uff01<\/p>\n<\/p><\/div>\n<div> <b>\u5927\u4f6c\u6709\u8a71\u8aaa<\/b> (<span>14<\/span>)        <\/div>\n<div> <\/div>\n<\/p><\/div>\n<\/p><\/div>\n<ul>\n<li data-pid=\"5750370\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : dorothyREN <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u7528\u6237\u7684\u521d\u59cb\u7ec4 \u4e0d\u663e\u793a\uff0c\u4f60\u518d\u52a0\u4e2a\u7ec4\u5c31\u6709\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750371\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \uff08\u8865\u5145\u7ec4\u624d\u9700\u8981\u5728 \/etc\/group \u91cc\u8bb0\u5f55\uff0c\u8fd9\u662f\u7ea6\u5b9a\uff09<br \/>\u4f60\u53ef\u4ee5\u53cd\u8fc7\u6765\u601d\u8003\u4e0b\u4e3a\u4ec0\u4e48\u8981\u8fd9\u6837\u7ea6\u5b9a<br \/>\u5047\u8bbe\u4e0d\u9075\u5faa\u7ea6\u5b9a\u4f1a\u53d1\u751f\u4ec0\u4e48\u3002\u3002\u3002<br \/>\u7b80\u5355\u8bf4\u5c31\u662f\u6570\u636e\u5e93\u8bbe\u8ba1\u91cc\u907f\u514d\u5197\u4f59\u7684\u65b9\u6cd5\uff0c\u5982\u679c\u5df2\u7ecf\u5728 passwd \u91cc\u51b3\u5b9a\u4e86\u4e3b\u7ec4\uff0c\u5982\u679c\u8fd8\u5728 group \u91cc\u91cd\u590d\u8bb0\u5f55\uff0c\u90a3\u4e48\u5728\u51fa\u73b0\u4e0d\u4e00\u81f4\u7684\u65f6\u5019\u5c31\u4f1a\u4ea7\u751f\u6b67\u4e49\uff0c\u5230\u5e95\u6309\u54ea\u4e2a\u8bb0\u5f55\u4e3a\u51c6\uff0c\u73b0\u5728\u8fd9\u6837\u8bbe\u8ba1\u5c31\u5f88\u660e\u786e\u4e86\uff0c\u767b\u5f55\u7684\u65f6\u5019\u7a0b\u5e8f\u53ea\u9700\u8981\u8bfb\u53d6 passwd \u6539\u53d8\u7a0b\u5e8f\u7684 UID gid\uff0c\u8bfb\u53d6 group \u626b\u63cf\u6709\u5bf9\u5e94\u7528\u6237\u7684 group\uff0c\u901a\u8fc7 setgroups \u7cfb\u7edf\u8c03\u7528\u8bbe\u7f6e\u8865\u5145\u7ec4\u5373\u53ef                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750372\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : AllenHua <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @codehz #2 \u6709\u8fd9\u4e2a\u7ea6\u5b9a\u5c31\u597d\u4e86\u3002\u8c22\u8c22\u89e3\u7b54\uff01                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750373\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : AllenHua <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @codehz #2 <\/p>\n<p>![20210410225440.png]( https:\/\/cdn.jsdelivr.net\/gh\/hellodk34\/<span data-cfemail=\"7d14101c1a183d101c1413\">[email&#160;protected]<\/span>\/img\/20210410225440.png)<\/p>\n<p>\u521a\u521b\u5efa test2 \u8fd9\u4e2a\u7528\u6237\uff0c\u5b83\u7684 supplementary group \uff08\u4e5f\u5c31\u662f GROUPS \uff09 \u5c31\u5305\u542b\u4e86 dkgroup \u4e86\uff08\u5c31\u662f\u5e16\u5b50\u6b63\u6587\u4e2d\u7684 testgroup \uff09\uff0c\u554a\u8fd9\uff0c\u4e3a\u5565 \/etc\/group \u6ca1\u6709\u663e\u793a\u5462<\/p>\n<p>\u624b\u52a8\u8ffd\u52a0 `usermod -a -G dkgroup test2` \u4e4b\u540e\u624d\u663e\u793a<\/p>\n<p>&#8220;`<br \/># id test2<br \/>uid=6803(test2) gid=6802(dkgroup) groups=6802(dkgroup),6802(dkgroup)<br \/>&#8220;`<\/p>\n<p>\u6b64\u65f6\u663e\u793a\u4e86\uff0c\u770b test2 \u7684 groups \u91cc\u6709\u4e24\u4e2a dkgroup \uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750374\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : palytoxin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u67e5\u4e86\u4e0b\uff0chttp:\/\/linux.vbird.org\/linux_basic\/0410accountmanager.php#account_group_init\uff0c\u9e1f\u54e5\u8fd9\u91cc\u8bb2\u7684\u6709\u6548\u7fa4\u7d44(effective group)\u8207\u521d\u59cb\u7fa4\u7d44(initial group)\u5e94\u8be5\u5bf9\u5e94\u4f60\u8bf4\u7684 primary group\uff0csupplementary group \u3002\u7136\u540e groups \u8fd8\u6709\u6839\u636e \/etc\/nsswitch.conf \u6240\u5b9a\u4e49\u7684\u4e00\u4e9b\u5185\u5bb9\uff0c\u4e0d\u8fc7\u6839\u636e\u4f60\u7684\u64cd\u4f5c\uff0c\u6211\u5728\u672c\u673a\u4e0a\u8bd5\u4e86\u8bd5\uff0cpasswd \u7684\u7fa4\u7ec4\u662f\u4e0d\u9700\u8981\u5728 \/etc\/group \u91cc\u4f53\u73b0\u7684                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750375\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : AllenHua <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @palytoxin #5 \u5bf9 \u4e3b\u7ec4\u5e94\u8be5\u4e0d\u9700\u8981\u5728 \/etc\/group \u4e2d\u4f53\u73b0\u3002\u8fd9\u662f\u56de\u5e94\u672c\u5e16\u6b63\u6587<\/p>\n<p>\u80fd\u5426\u63a5\u7740\u770b\u770b 4 \u7684\u5185\u5bb9\uff1f                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750376\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : palytoxin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             man usermod \u6709\u4e2a<\/p>\n<p>-g, &#8211;gid GROUP<br \/> The group name or number of the user&#8217;s new initial login group. The group must exist.<\/p>\n<p> Any file from the user&#8217;s home directory owned by the previous primary group of the user will be owned by<br \/> this new group.<\/p>\n<p> The group ownership of files outside of the user&#8217;s home directory must be fixed manually.<\/p>\n<p>-G, &#8211;groups GROUP1[,GROUP2,&#8230;[,GROUPN]]]<br \/> A list of supplementary groups which the user is also a member of. Each group is separated from the next<br \/> by a comma, with no intervening whitespace. The groups are subject to the same restrictions as the group<br \/> given with the -g option.<\/p>\n<p> If the user is currently a member of a group which is not listed, the user will be removed from the<br \/> group. This behaviour can be changed via the -a option, which appends the user to the current<br \/> supplementary group list.<\/p>\n<p>\u6211\u81ea\u5df1\u6d4b\u8bd5<br \/>usermod -g testgroup test2<br \/>usermod: no changes<\/p>\n<p>-g \u662f\u521d\u59cb\u7ec4 -G \u662f\u8ffd\u52a0\u7ec4<\/p>\n<p>\u4e0d\u8fc7\u5728\u6211\u8fd9\u91cc \u8ffd\u52a0`usermod -a -G testgroup test2` \u8fd8\u662f\u663e\u793a\u4e00\u4e2a testgroup<br \/>id test2<br \/>uid=1002(test2) gid=1002(testgroup) groups=1002(testgroup)<\/p>\n<p>\u8fd9\u4e2a\u8003\u8651\u4f60\u7684\u8f6f\u4ef6\u73af\u5883                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750377\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : palytoxin <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             id -Gn test2 \u663e\u793a\u4ec0\u4e48\uff1f                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750378\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @AllenHua \u8fd9\u4e0d\u5c31\u662f\u6211\u8bf4\u7684\u4e0d\u9075\u5faa\u7ea6\u5b9a\u7684\u540e\u679c\u5417\uff0c\u4f60\u7684\u4e3b\u8981\u7ec4\u5df2\u7ecf\u662f\u662f dkgroup \u4e86\uff0c\u7136\u540e\u518d\u52a0\u5165 group \u91cc\uff0cid \u7a0b\u5e8f\u5c31\u4f1a\u663e\u793a\u4e24\u4e2a\u4e86\u3002\u3002\u3002<br \/>id \u7a0b\u5e8f\u7684\u903b\u8f91\u4f60\u53ef\u4ee5\u7406\u89e3\u6210\u8fd9\u6837<br \/>\u4e3b\u7ec4(\/etc\/passwd \u62ff\u5230\u7684)\u7684\u52a0\u5165 groups \u663e\u793a<br \/>\u8865\u5145\u7ec4\uff08\/etc\/group \u62ff\u5230\u7684\uff09\u4e5f\u52a0\u5165 groups \u663e\u793a\uff0c\u7136\u540e\u8fd9\u91cc\u6ca1\u6709\u505a\u53bb\u91cd\u5904\u7406\uff0c\u5c31\u663e\u793a\u51fa\u4e24\u4e2a\u4e86\u3002<br \/>\u4f60\u76f4\u63a5 su \u767b\u5f55\u90a3\u4e2a\u8d26\u6237\uff0c\u518d\u7528 id \u547d\u4ee4\uff0c\u6b64\u65f6\u5e94\u8be5\u4f1a\u8d70\u53e6\u4e00\u4e2a\u903b\u8f91\uff0c\u76f4\u63a5\u4ece\u5f53\u524d\u8fdb\u7a0b\u83b7\u53d6 gid \u548c groups\uff0c\u8fd9\u6837\u5e94\u8be5\u4e0d\u81f3\u4e8e\u663e\u793a\u51fa\u4e24\u4e2a\u91cd\u590d\u7684 dkgroup \u4e86\uff08\u6839\u636e https:\/\/man.archlinux.org\/man\/getgroups.2 \u6587\u6863\uff0cgetgroups \u53ef\u80fd\u6216\u4e0d\u80fd\u5217\u51fa\u4e3b\u7ec4\uff0c\u6240\u4ee5\u5e94\u7528\u7a0b\u5e8f\u8981\u81ea\u5df1\u6574\u7406\uff0cid \u7a0b\u5e8f\u5e94\u8be5\u4f1a\u81ea\u5df1\u53bb\u9664\u91cd\u590d\u9879\u76ee\uff09                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750379\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : codehz <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             linux \u7528\u6237\u7ec4\u7ba1\u7406\u6574\u4e2a\u90fd\u662f\u7528\u6237\u6001\u5904\u7406\u7684\uff0c\u5185\u6838\u53ea\u8ba4\u8bc6\u6570\u5b57\uff0c\u4e5f\u4e0d\u4f1a\u53bb\u8bfb\u53d6\u6587\u4ef6\u4ec0\u4e48\u7684\uff0c\u6240\u4ee5\u6309\u7167\u7a0b\u5e8f\u663e\u793a\u53bb\u5b66 linux \u673a\u5236\uff0c\u662f\u8981\u9047\u5751\u7684\u3002\u3002\u3002<br \/>linux \u5185\u6838\u7684\u89c6\u89d2\u6765\u770b\uff0c\u5c31\u53ea\u80fd\u770b\u5230\u5982\u4e0b\u8fd9\u4e9b\u4fe1\u606f\uff08\u6682\u65f6\u4e0d\u8003\u8651 euid \u7b49\u590d\u6742\u7684\u673a\u5236\uff09\u8fd9\u4e9b\u4fe1\u606f\u90fd\u662f\u5f52\u5c5e\u4e8e\u8fdb\u7a0b\u7684<br \/>uid gid groups<br \/>\u5bf9\u5e94\u7684\u5c31\u662f\u7528\u6237 id\uff0c\u4e3b\u7ec4 id\uff0c\u8865\u5145\u7ec4 id<br \/>\u4e3a\u4ec0\u4e48\u8981\u533a\u5206\u4e3b\u7ec4\u548c\u8865\u5145\u7ec4\u5462\uff0c\u9664\u4e86\u5386\u53f2\u539f\u56e0\u4e4b\u5916\uff0c\u5c31\u662f\u4e3a\u4e86\u5728\u4f7f\u7528\u6587\u4ef6\u64cd\u4f5c\u7684\u65f6\u5019\u6709\u4e00\u4e2a\u552f\u4e00\u7684 gid \u53ef\u7528\uff0c\u6bd5\u7adf\u6587\u4ef6\u53ea\u80fd\u6709\u4e00\u4e2a gid<br \/>\u4f46\u662f id \u7a0b\u5e8f\uff0c\u4e3a\u4e86\u7528\u6237\u65b9\u4fbf\uff0c\u5c31\u628a\u4e3b\u7ec4\u4e5f\u52a0\u5165\u8865\u5145\u7ec4\u7684\u8303\u7574\u5185\u4e86\uff0c\u8fd9\u6837\u5c31\u80fd\u4e00\u773c\u770b\u51fa\u7528\u6237\u52a0\u5165\u4e86\u54ea\u4e9b\u7ec4\u4e86                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750380\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : AllenHua <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @palytoxin #8 \u663e\u793a testgroup<\/p>\n<p>-g \u662f\u8bbe\u7f6e primary group<\/p>\n<p>-G \u662f\u8bbe\u7f6e supplementary group<\/p>\n<p>\u770b\u6765\u548c\u4e0d\u540c\u7684 linux \u73af\u5883\u6709\u5173 \u6211\u76ee\u524d\u662f\u5728 openwrt \u4e0b \u6211\u540e\u9762\u518d\u8bd5\u8bd5\u624b\u5934\u7684 ubuntu \u8c22\u8c22\u8001\u54e5                                                            <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750381\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : AllenHua <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @codehz #10 \u597d\u7684 \u975e\u5e38\u611f\u8c22\uff01                                                             <\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750382\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u4e3b<\/span> <span>\u8cc7\u6df1\u5927\u4f6c : AllenHua <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             @palytoxin #7 -g \u5c31\u662f\u6539\u4e3b\u7ec4<\/p>\n<p>\u521a\u5728 ubuntu \u4e0b\u6d4b\u8bd5\u4e86 groups \u5e76\u6ca1\u6709\u53d8\u6210\u4e24\u4e2a hhh<\/p>\n<p> `usermod -a -G testgroup test2` \u540e<\/p>\n<p>\u6267\u884c id test2 groups \u6ca1\u6709\u51fa\u73b0\u4e24\u4e2a                                                             <\/p><\/div>\n<\/p><\/div>\n<\/li>\n<li data-pid=\"5750383\" data-uid=\"2\">\n<div>\n<div>\n<div> <span>\u8cc7\u6df1\u5927\u4f6c : mikeguan <\/span>  <\/div>\n<div> <i title=\"\u5f15\u7528\"><\/i>  <span>          <\/span> <\/div>\n<\/p><\/div>\n<div>                                                             \u4e3b\u7528\u6237\u7ec4\u4f60\u4e0d\u662f\u5df2\u7ecf\u53ef\u4ee5\u67e5\u5230\u4e86\u5417\uff1f Linux \u4e5f\u53ef\u4ee5\u67e5\u5230\u5440\uff0c\u5982\u679c\u5199\u4e86\u53cd\u800c\u611f\u89c9\u662f\u753b\u86c7\u6dfb\u8db3                                                            <\/div>\n<\/p><\/div>\n<\/li>\n<li>\n","protected":false},"excerpt":{"rendered":"<p>\u95ee\u4e2a Linux \u95ee\u9898\uff0c\u7ea0\u7ed3\u4e00\u4e0b\u5348&hellip;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[],"tags":[],"_links":{"self":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/438628"}],"collection":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=438628"}],"version-history":[{"count":0,"href":"http:\/\/4563.org\/index.php?rest_route=\/wp\/v2\/posts\/438628\/revisions"}],"wp:attachment":[{"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=438628"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=438628"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/4563.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=438628"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}