{"id":1068,"date":"2021-05-18T13:46:17","date_gmt":"2021-05-18T05:46:17","guid":{"rendered":"https:\/\/www.linuxdevops.cn\/?p=1068"},"modified":"2021-05-18T13:47:20","modified_gmt":"2021-05-18T05:47:20","slug":"02-linux-basic-course-user-and-user-group-management","status":"publish","type":"post","link":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/","title":{"rendered":"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406"},"content":{"rendered":"

Linux\u4e2d\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406<\/h1>\n

\u539f\u6587\u94fe\u63a5<\/strong>\uff1ahttps:\/\/www.cnblogs.com\/ddz-linux\/p\/10467106.html<\/a><\/strong><\/p>\n

Linux\u4f5c\u4e3a\u4e00\u79cd\u591a\u7528\u6237\u7684\u64cd\u4f5c\u7cfb\u7edf(\u670d\u52a1\u5668\u7cfb\u7edf)\uff0c\u5141\u8bb8\u591a\u4e2a\u7528\u6237\u540c\u65f6\u767b\u9646\u5230\u7cfb\u7edf\u4e0a\uff0c\u5e76\u54cd\u5e94\u6bcf\u4e2a\u7528\u6237\u7684\u8bf7\u6c42\u3002<\/p>\n

\u4efb\u4f55\u9700\u8981\u4f7f\u7528\u64cd\u4f5c\u7cfb\u7edf\u7684\u7528\u6237\uff0c\u90fd\u9700\u8981\u4e00\u4e2a\u7cfb\u7edf\u8d26\u53f7\uff0c\u8d26\u53f7\u5206\u4e3a\uff1a\u7ba1\u7406\u5458\u8d26\u53f7\u4e0e\u666e\u901a\u7528\u6237\u8d26\u53f7\u3002<\/strong><\/p>\n

\u5728Linux\u4e2d\uff0c\u64cd\u4f5c\u7cfb\u7edf \u6839\u636eUID\u6765\u5224\u65ad\u7528\uff01\u6839\u636eUID\u6765\u5224\u65ad\u7528\u6237\uff01<\/strong> \u800c\u4e0d\u662f\u7528\u6237\u540d\uff01\u53ea\u8981id\u4e3a0\u5c31\u662f\u7ba1\u7406\u5458\uff0c\u54ea\u6015\u6709\u591a\u4e2aid\u4e3a0 \u7684\u8d26\u53f7<\/strong><\/p>\n

\u7cfb\u7edf\u5728\u65b0\u5efa\u8d26\u53f7\u65f6\uff0c\u4f1a\u6839\u636e\u8d26\u53f7\u7c7b\u578b\uff0c\u81ea\u52a8\u5206\u914d\u9012\u589e\u8d26\u53f7\u7684UID\u4e0eGID \uff08\u7528\u6237\u8eab\u4efd\u7f16\u53f7\uff0c\u7ec4\u7f16\u53f7\uff09,\u4e5f\u53ef\u81ea\u884c\u5206\u914d\u3002\u901a\u5e38\u60c5\u51b5\u4e0b\uff0c\u5e94\u5f53\u4fdd\u8bc1UID\u4e0eGID\u552f\u4e00\u4e14\u4e0d\u91cd\u590d\u3002<\/strong><\/p>\n

1.1 \u7ec4\u7684\u7c7b\u522b<\/h2>\n

\u5728Linux\u4e2d\uff0c\u6bcf\u4e2a\u7528\u6237\u5fc5\u987b\u6709\u4e00\u4e2a\u4e3b\u7ec4\u3002\u5f53\u521b\u5efa\u8d26\u53f7\u65f6\uff0c\u7cfb\u7edf\u4f1a\u81ea\u52a8\u521b\u5efa\u4e00\u4e2a\u540c\u540d\u7ec4\u4f5c\u4e3a\u8be5\u8d26\u6237\u7684\u4e3b\u7ec4\u3002\u7528\u6237\u5fc5\u987b\u5c5e\u4e8e\u4e00\u4e2a\u4e14\u53ea\u6709\u4e00\u4e2a\u4e3b\u7ec4\u3002\u7528\u6237\u53ef\u4ee5\u5c5e\u4e8e\u96f6\u4e2a\u6216\u8005\u591a\u4e2a\u9644\u52a0\u7ec4\u3002<\/p>\n

1.2 \u7528\u6237\u4e0e\u7ec4\u7684\u914d\u7f6e\u6587\u4ef6<\/h2>\n

\u5728Linux\u4e2d\uff0c\u4e07\u7269\u7686\u6587\u4ef6<\/strong>\uff0c\u6240\u4ee5\u7528\u6237\u4e0e\u7ec4\u4e5f\u4ee5\u914d\u7f6e\u6587\u4ef6\u7684\u5f62\u5f0f\u4fdd\u5b58\u5728\u7cfb\u7edf\u4e2d\uff0c\u4ee5\u4e0b\u4e3a\u7528\u6237\u548c\u7ec4\u7684\u4e3b\u8981\u914d\u7f6e\u6587\u4ef6\u8be6\u89e3\uff1a<\/p>\n

 -   \/etc\/passwd\uff1a\u7528\u6237\u53ca\u5176\u5c5e\u6027\u4fe1\u606f(\u540d\u79f0\u3001 UID\u3001\u4e3b\u7ec4ID\u7b49\uff09\n -   \/etc\/group\uff1a\u7ec4\u53ca\u5176\u5c5e\u6027\u4fe1\u606f\n -   \/etc\/shadow\uff1a\u7528\u6237\u5bc6\u7801\u53ca\u5176\u76f8\u5173\u5c5e\u6027\n -   \/etc\/gshadow\uff1a\u7ec4\u5bc6\u7801\u53ca\u5176\u76f8\u5173\u5c5e\u6027<\/code><\/pre>\n

passwd\u6587\u4ef6\u683c\u5f0f\u5982\u4e0b\u56fe:<\/p>\n

\"img\"<\/p>\n

\u4f9d\u6b21\u542b\u4e49\u4e3a\uff1a<\/p>\n

    \n
  • \u767b\u5f55\u7528\u6237\u540d<\/li>\n
  • \u5bc6\u7801<\/li>\n
  • UID<\/li>\n
  • GID<\/li>\n
  • \u5168\u540d\u6216\u6ce8\u91ca<\/li>\n
  • \u7528\u6237\u4e3b\u76ee\u5f55<\/li>\n
  • \u7528\u6237\u9ed8\u8ba4\u4f7f\u7528shell<\/li>\n<\/ul>\n

    group\u6587\u4ef6\u683c\u5f0f\u5982\u4e0b\u56fe:<\/p>\n

    \"img\"<\/p>\n

    \u4f9d\u6b21\u542b\u4e49\u4e3a\uff1a<\/p>\n

      \n
    • \u7fa4\u7ec4\u540d\u79f0<\/li>\n
    • \u7fa4\u7ec4\u5bc6\u7801\uff08\u901a\u5e38\u4e0d\u9700\u8981\u8bbe\u5b9a\uff0c\u5bc6\u7801\u88ab\u8bb0\u5f55\u5728\/etc\/gshadow\uff09<\/li>\n
    • GID\uff1a\u7fa4\u7ec4ID<\/li>\n
    • \u9644\u52a0\u7ec4\uff08\u4ee5\uff0c\u6765\u5206\u5272\uff0c\u8be5\u8d26\u6237\u6ca1\u6709\u9644\u52a0\u7ec4\u6240\u4ee5\u4e3a\u7a7a\uff09<\/li>\n<\/ul>\n

      shadow\u6587\u4ef6\u683c\u5f0f\u5982\u4e0b\u56fe:<\/p>\n

      \"img\"<\/p>\n

      \u4f9d\u6b21\u542b\u4e49\u4e3a:<\/p>\n

        \n
      • \u767b\u5f55\u7528\u6237\u540d<\/li>\n
      • \u5bc6\u7801\uff08\u901a\u5e38\u4f7f\u7528shad512\u52a0\u5bc6)<\/li>\n
      • \u4ece1970\u5e741\u67081\u65e5\u8d77\u8ba1\u7b97\u5230\u73b0\u5728\u4e3a\u6b62\u5bc6\u7801\u6700\u8fd1\u4e00\u6b21\u88ab\u66f4\u6539\u7684\u65f6\u95f4<\/li>\n
      • \u5bc6\u7801\u518d\u8fc7\u51e0\u5929\u5c31\u53ef\u4ee5\u88ab\u4fee\u6539(0\u8868\u793a\u968f\u65f6\u53ef\u6539)<\/li>\n
      • \u5bc6\u7801\u51e0\u5929\u540e\u5fc5\u987b\u53d8\u66f4\uff0899999\u8868\u793a\u6c38\u4e0d\u8fc7\u671f\uff09<\/li>\n
      • \u5bc6\u7801\u8fc7\u671f\u524d\u591a\u4e45\u63d0\u793a\u7528\u6237<\/li>\n
      • \u5bc6\u7801\u8fc7\u671f\u591a\u4e45\u540e\u8d26\u6237\u5c06\u88ab\u9501\u5b9a<\/li>\n
      • \u591a\u5c11\u5929\u540e\u8d26\u6237\u5c06\u5931\u6548(\u4ece1970-1-1\u7b97\u8d77)<\/li>\n<\/ul>\n

        gshadow\u6587\u4ef6\u683c\u5f0f\u5982\u4e0b\u56fe\uff1a<\/p>\n

        \"img\"<\/p>\n

        \u4f9d\u6b21\u542b\u4e49\u4e3a:<\/p>\n

          \n
        • \u7fa4\u7ec4\u540d\u79f0<\/li>\n
        • \u7fa4\u7ec4\u5bc6\u7801<\/li>\n
        • \u7ec4\u7ba1\u7406\u5458\u5217\u8868<\/li>\n
        • \u5f53\u524d\u7528\u6237\u7684\u9644\u52a0\u7ec4<\/li>\n<\/ul>\n

          2.\u7528\u6237\u8d26\u53f7\u7ba1\u7406<\/h1>\n

          \u5728Linux\uff0c\u7ba1\u7406\u5458\u5728\u9ed8\u8ba4\u60c5\u51b5\u4e0b\u4e3aroot\u8d26\u6237\uff0cUID=0\u3002\u666e\u901a\u7528\u6237UID\u9ed8\u8ba4\u8303\u56f4\u4e3a1-65535\u3002\u5728centos 6\u4e2d\uff0c\u65b0\u5efa\u7528\u6237\uff0c\u9ed8\u8ba4\u7cfb\u7edf\u7528\u6237\u7684UID\u8303\u56f4\u4e3a1-499\u3002\u666e\u901a\u7528\u6237\u4e3a500+\u3002\u5728centos 7\u4e2d\uff0c\u7cfb\u7edf\u7528\u6237\u8303\u56f4\u4e3a1-999\u3002\u666e\u901a\u7528\u6237\u4e3a1000+\u3002\u5bf9\u7cfb\u7edf\u7684\u64cd\u4f5c\u6743\u9650\u7531\u7528\u6237\u51b3\u5b9a\u3002<\/strong><\/p>\n

          \u901a\u5e38\u5bf9\u7528\u6237\u8d26\u53f7\u7684\u64cd\u4f5c\u5206\u4e3a\u6dfb\u52a0\uff0c\u4fee\u6539\uff0c\u5220\u9664\u3002<\/p>\n

          2.1 \u6dfb\u52a0\u8d26\u6237<\/h2>\n

          \u901a\u8fc7\uff1auseradd\u547d\u4ee4\uff0c\u6765\u6dfb\u52a0\u7528\u6237\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n

          useradd [opentions] login<\/code><\/pre>\n

          \u53c2\u6570\u8bf4\u660e\uff1a<\/p>\n

            \n
          • \n

            -u UID \u81ea\u5b9a\u4e49UID \uff08\u9ed8\u8ba4\u7cfb\u7edf\u9012\u589e\uff09<\/p>\n<\/li>\n

          • \n

            -o \u914d\u5408-u \u9009\u9879\uff0c\u4e0d\u68c0\u67e5UID\u7684\u552f\u4e00\u6027(\u4e0d\u5efa\u8bae)<\/p>\n<\/li>\n

          • \n

            -g GID\uff1a\u6307\u660e\u7528\u6237\u6240\u5c5e\u57fa\u672c\u7ec4\uff0c\u53ef\u4e3a\u7ec4\u540d\uff0c\u4e5f\u53ef\u4ee5GID<\/p>\n<\/li>\n

          • \n

            -c comment \u6307\u5b9a\u4e00\u6bb5\u6ce8\u91ca\u6027\u63cf\u8ff0\u3002<\/p>\n<\/li>\n

          • \n

            -d \u76ee\u5f55 \u6307\u5b9a\u7528\u6237\u4e3b\u76ee\u5f55\uff0c\u5982\u679c\u6b64\u76ee\u5f55\u4e0d\u5b58\u5728\uff0c\u5219\u540c\u65f6\u4f7f\u7528-m\u9009\u9879\uff0c\u53ef\u4ee5\u521b\u5efa\u4e3b\u76ee\u5f55\u3002<\/p>\n<\/li>\n

          • \n

            -g \u7528\u6237\u7ec4 \u6307\u5b9a\u7528\u6237\u6240\u5c5e\u7684\u7528\u6237\u7ec4\u3002<\/p>\n<\/li>\n

          • \n

            -G \u7528\u6237\u7ec4\uff0c\u7528\u6237\u7ec4 \u6307\u5b9a\u7528\u6237\u6240\u5c5e\u7684\u9644\u52a0\u7ec4\u3002<\/p>\n<\/li>\n

          • \n

            -s Shell\u6587\u4ef6 \u6307\u5b9a\u7528\u6237\u7684\u767b\u5f55Shell\u3002<\/p>\n<\/li>\n

          • \n

            -u \u7528\u6237\u53f7 \u6307\u5b9a\u7528\u6237\u7684\u7528\u6237\u53f7\uff0c\u5982\u679c\u540c\u65f6\u6709-o\u9009\u9879\uff0c\u5219\u53ef\u4ee5\u91cd\u590d\u4f7f\u7528\u5176\u4ed6\u7528\u6237\u7684\u6807\u8bc6\u53f7\u3002<\/p>\n<\/li>\n<\/ul>\n

            \u5b9e\u4f8b1<\/h4>\n
            # useradd \u2013d \/usr\/ddz ddz<\/code><\/pre>\n

            \u521b\u5efa\u4e86\u4e00\u4e2a\u7528\u6237ddz\uff0c\u5e76\u5c06\u4ed6\u7684\u5bb6\u76ee\u5f55\u8bbe\u7f6e\u5230\/user\/ddz<\/p>\n

            \u5b9e\u4f8b2<\/h4>\n
            # useradd -s \/sbin\/bash -g root \u2013G mage,wang ddz<\/code><\/pre>\n

            \u6b64\u547d\u4ee4\u65b0\u5efa\u4e86\u4e00\u4e2a\u7528\u6237ddz\uff0c\u8bbe\u7f6e\u8be5\u7528\u6237\u4f7f\u7528\u7684shell\u4e3a\/sbin\/bash,\u8bbe\u7f6e\u4ed6\u7684\u4e3b\u7ec4\u5c5e\u4e8egroup\u7528\u6237\u7ec4\uff0c\u8bbe\u7f6e\u9644\u52a0\u7ec4\u4e3amage\u548cwang\u3002(\u5f53\u8bbe\u7f6e\u7ec4\u65f6\uff0c\u8981\u4fdd\u8bc1\u7ec4\u5df2\u7ecf\u5b58\u5728\uff0c\u5426\u5219\u8bf7\u5148\u521b\u5efa\u8be5\u7ec4<\/strong>)<\/p>\n

            \u5c0f\u6280\u5de7:<\/strong><\/p>\n

              \n
            • \u589e\u52a0\u7528\u6237\u8d26\u53f7\u5c31\u662f\u5728\/etc\/passwd\u6587\u4ef6\u4e2d\u4e3a\u65b0\u7528\u6237\u589e\u52a0\u4e00\u6761\u8bb0\u5f55\uff0c\u540c\u65f6\u7cfb\u7edf\u4f1a\u81ea\u52a8\u66f4\u65b0<\/strong>\u5176\u4ed6\u7cfb\u7edf\u6587\u4ef6\u5982\/etc\/shadow, \/etc\/group\u7b49\u3002<\/li>\n
            • \u901a\u5e38\u60c5\u51b5\u521b\u5efa\u8d26\u6237\uff0c\u8d26\u6237ID\u4f1a\u6309\u7167\u6700\u5927\u7684\u503c\u9012\u589e\uff0c\u4f46\u662f\u9012\u589e\u7684\u503c\u5fc5\u987b\u5728\u6700\u5927\u8303\u56f4\u5185\u3002<\/li>\n
            • \u5728\u90e8\u7f72\u8f6f\u4ef6\u65f6\uff0c\u901a\u5e38\u4f1a\u9700\u8981\u4f7f\u7528\u8d26\u6237\uff0c\u6240\u4ee5\u9700\u8981\u6307\u5b9aUID\uff0c\u6765\u90e8\u7f72\u6240\u6709\u7684\u8d26\u53f7\u90fd\u7528\u540c\u4e00\u4e2aUID\uff0c\u6765\u65b9\u4fbf\u7ba1\u7406\u3002<\/li>\n
            • newusers [passwd\u683c\u5f0f\u6587\u4ef6] \u7528\u4e8e\u6279\u91cf\u521b\u5efa\u8d26\u6237,\u53ea\u9700\u8981\u6bcf\u4e00\u5217\u8d26\u6237\u4fe1\u606f\u683c\u5f0f\uff0c\u6309\u7167passwd\u4e2d\u4e66\u5199\uff0c\u4e4b\u540e\u4e0a\u4f20\u5230Linux\u4e2d\u66ff\u6362\u5373\u53ef\u3002<\/li>\n
            • chpasswd \u6279\u91cf\u4fee\u6539\u7528\u6237\u53e3\u4ee4\u3002\u5c06\u6587\u4ef6\u683c\u5f0f\u5199\u4e3a\uff1auser:passwd \u3002\u6bcf\u884c\u4e00\u4e2a\uff0c\u4e4b\u540e\u5012\u5165linux\u5373\u53ef\u3002<\/li>\n
            • \u521b\u5efa\u8d26\u6237\u7684\u9ed8\u8ba4\u503c\u8bbe\u5b9a\u4f4d\u4e8e\uff1a \/etc\/default\/useradd\u6587\u4ef6\u4e2d\uff0c\u8be5\u6587\u4ef6\u8bb0\u5f55\u4e86\u521b\u5efa\u7528\u6237\u8d26\u6237\u65f6\u7684\u9ed8\u8ba4\u4fe1\u606f\uff0c\u53ef\u901a\u8fc7\u4fee\u6539\u8be5\u6587\u4ef6\u6765\u4fee\u6539\u521b\u5efa\u8d26\u6237\u65f6\u7684\u4fe1\u606f\u3002<\/li>\n<\/ul>\n

              \u5b9e\u4f8b3<\/h4>\n
              # \u6dfb\u52a0\u6267\u884c docker \u547d\u4ee4\u7684\u7528\u6237\uff0c\u8fd9\u91cc\u4e3a ibaboss\nuseradd ibaboss\n\n# \u628a ibaboss \u7528\u6237\u52a0\u5165 docker \u7ec4\nusermod -G docker ibaboss  \n# \u52a0\u5165\u591a\u4e2a\u7ec4, usermod -G docker,es ibaboss<\/code><\/pre>\n

              \u6dfb\u52a0\u666e\u901a\u7528\u6237\u5230docker \u7ec4\uff0c\u4f7f\u666e\u901a\u7528\u6237\u53ef\u4ee5\u6267\u884cdocker\u547d\u4ee4\u3002<\/p>\n

              2.2 \u5220\u9664\u5e10\u53f7<\/h3>\n

              \u5982\u679c\u4e00\u4e2a\u7528\u6237\u7684\u8d26\u53f7\u4e0d\u518d\u4f7f\u7528\uff0c\u53ef\u4ee5\u4ece\u7cfb\u7edf\u4e2d\u5220\u9664\u3002\u5220\u9664\u7528\u6237\u8d26\u53f7\u5c31\u662f\u8981\u5c06\/etc\/passwd\u7b49\u7cfb\u7edf\u6587\u4ef6\u4e2d\u7684\u8be5\u7528\u6237\u8bb0\u5f55\u5220\u9664\uff0c\u5fc5\u8981\u65f6\u8fd8\u5220\u9664\u7528\u6237\u7684\u4e3b\u76ee\u5f55\u3002<\/p>\n

              \u901a\u5e38\u5728\u8fd0\u7ef4\u5de5\u4f5c\u4e2d\uff0c\u4e00\u822c\u4f7f\u7528\u8ba9\u8d26\u53f7\u5931\u6548\uff0c\u679c\u7136\u4fee\u6539\u8d26\u6237\u540d\u7684\u65b9\u5f0f\uff0c\u6765\u4fbf\u6377\u7684\u64cd\u4f5c\u8d26\u53f7\u3002<\/p>\n

              \u5220\u9664\u4e00\u4e2a\u5df2\u6709\u7684\u7528\u6237\u8d26\u53f7\u4f7f\u7528userdel<\/code>\u547d\u4ee4\uff0c\u5176\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

              userdel \u9009\u9879 \u7528\u6237\u540d<\/code><\/pre>\n

              \u5e38\u7528\u7684\u9009\u9879\u662f -r\uff0c\u5b83\u7684\u4f5c\u7528\u662f\u628a\u7528\u6237\u7684\u4e3b\u76ee\u5f55\u4e00\u8d77\u5220\u9664\u3002<\/p>\n

              \u4f8b\u5982\uff1a<\/p>\n

              # userdel -r sam<\/code><\/pre>\n

              \u6b64\u547d\u4ee4\u5220\u9664\u7528\u6237sam\u5728\u7cfb\u7edf\u6587\u4ef6\u4e2d\uff08\u4e3b\u8981\u662f\/etc\/passwd, \/etc\/shadow, \/etc\/group\u7b49\uff09\u7684\u8bb0\u5f55\uff0c\u540c\u65f6\u5220\u9664\u7528\u6237\u7684\u4e3b\u76ee\u5f55\u3002<\/p>\n

              \u5220\u9664\u8d26\u53f7\u9700\u8981\u8be5\u8d26\u6237\u6ca1\u6709\u4eba\u5728\u4f7f\u7528\uff0c\u624d\u80fd\u5220\u9664\u6210\u529f\u3002\u8bf7\u4f7f\u7528\u547d\u4ee4\u5220\u9664\uff0c\u4e0d\u8981\u53bb\u624b\u52a8\u6539\u6587\u4ef6\u3002<\/p>\n

              2.3 \u4fee\u6539\u5e10\u53f7<\/h3>\n

              \u4fee\u6539\u7528\u6237\u8d26\u53f7\u5c31\u662f\u6839\u636e\u5b9e\u9645\u60c5\u51b5\u66f4\u6539\u7528\u6237\u7684\u6709\u5173\u5c5e\u6027\uff0c\u5982\u7528\u6237\u53f7\u3001\u4e3b\u76ee\u5f55\u3001\u7528\u6237\u7ec4\u3001\u767b\u5f55Shell\u7b49\u3002<\/p>\n

              \u4fee\u6539\u5df2\u6709\u7528\u6237\u7684\u4fe1\u606f\u4f7f\u7528usermod<\/code>\u547d\u4ee4\uff0c\u5176\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

              usermod \u9009\u9879 \u7528\u6237\u540d<\/code><\/pre>\n

              \u5e38\u7528\u7684\u9009\u9879\u5305\u62ec-c, -d, -m, -g, -G, -s, -u\u4ee5\u53ca-o\u7b49<\/code>\uff0c\u8fd9\u4e9b\u9009\u9879\u7684\u610f\u4e49\u4e0euseradd<\/code>\u547d\u4ee4\u4e2d\u7684\u9009\u9879\u4e00\u6837\uff0c\u53ef\u4ee5\u4e3a\u7528\u6237\u6307\u5b9a\u65b0\u7684\u8d44\u6e90\u503c\u3002<\/p>\n

              \u53e6\u5916\uff0c\u6709\u4e9b\u7cfb\u7edf\u53ef\u4ee5\u4f7f\u7528\u9009\u9879\uff1a-l \u65b0\u7528\u6237\u540d<\/p>\n

              \u8fd9\u4e2a\u9009\u9879\u6307\u5b9a\u4e00\u4e2a\u65b0\u7684\u8d26\u53f7\uff0c\u5373\u5c06\u539f\u6765\u7684\u7528\u6237\u540d\u6539\u4e3a\u65b0\u7684\u7528\u6237\u540d\u3002<\/p>\n

              \u4f8b\u5982\uff1a<\/p>\n

              # usermod -s \/bin\/ksh -d \/home\/z \u2013g developer sam<\/code><\/pre>\n

              \u6b64\u547d\u4ee4\u5c06\u7528\u6237sam\u7684\u767b\u5f55Shell\u4fee\u6539\u4e3aksh\uff0c\u4e3b\u76ee\u5f55\u6539\u4e3a\/home\/z\uff0c\u7528\u6237\u7ec4\u6539\u4e3adeveloper\u3002<\/p>\n

              2.4 \u67e5\u8be2\u8d26\u53f7\u53e3\u4ee4<\/h3>\n
              id [opentions] [User]<\/code><\/pre>\n

              \u76f8\u5173\u53c2\u6570:<\/p>\n

                \n
              • -u:\u663e\u793aUID<\/li>\n
              • -g:\u663e\u793aGID<\/li>\n
              • -G:\u663e\u793a\u7528\u6237\u6240\u5c5e\u7684\u7ec4ID<\/li>\n
              • -n:\u663e\u793a\u540d\u79f0<\/li>\n<\/ul>\n

                2.5 \u7528\u6237\u53e3\u4ee4\u7684\u7ba1\u7406<\/h3>\n

                \u7528\u6237\u7ba1\u7406\u7684\u4e00\u9879\u91cd\u8981\u5185\u5bb9\u662f\u7528\u6237\u53e3\u4ee4\u7684\u7ba1\u7406\u3002\u7528\u6237\u8d26\u53f7\u521a\u521b\u5efa\u65f6\u6ca1\u6709\u53e3\u4ee4\uff0c\u4f46\u662f\u88ab\u7cfb\u7edf\u9501\u5b9a\uff0c\u65e0\u6cd5\u4f7f\u7528\uff08\u5728passwd\u6587\u4ef6\u4e2d\uff0c\u5bc6\u7801\u5217\u663e\u793a\u4e3a\uff01\uff01\u6216\u8005\uff01\u8868\u793a\u7528\u6237\u88ab\u9501\u5b9a\uff0c\u662f\u65e0\u6cd5\u767b\u9646\u7684\uff09\uff0c\u5fc5\u987b\u4e3a\u5176\u6307\u5b9a\u53e3\u4ee4\u540e\u624d\u53ef\u4ee5\u4f7f\u7528\uff0c\u5373\u4f7f\u662f\u6307\u5b9a\u7a7a\u53e3\u4ee4\u3002<\/p>\n

                \u6307\u5b9a\u548c\u4fee\u6539\u7528\u6237\u53e3\u4ee4\u7684Shell\u547d\u4ee4\u662fpasswd<\/code>\u3002\u8d85\u7ea7\u7528\u6237\u53ef\u4ee5\u4e3a\u81ea\u5df1\u548c\u5176\u4ed6\u7528\u6237\u6307\u5b9a\u53e3\u4ee4\uff0c\u666e\u901a\u7528\u6237\u53ea\u80fd\u7528\u5b83\u4fee\u6539\u81ea\u5df1\u7684\u53e3\u4ee4\u3002\u547d\u4ee4\u7684\u683c\u5f0f\u4e3a\uff1a<\/p>\n

                passwd \u9009\u9879 \u7528\u6237\u540d<\/code><\/pre>\n

                \u53ef\u4f7f\u7528\u7684\u9009\u9879\uff1a<\/p>\n

                  \n
                • -l \u9501\u5b9a\u53e3\u4ee4\uff0c\u5373\u7981\u7528\u8d26\u53f7\u3002<\/li>\n
                • -u \u53e3\u4ee4\u89e3\u9501\u3002<\/li>\n
                • -d \u4f7f\u8d26\u53f7\u65e0\u53e3\u4ee4\u3002<\/li>\n
                • -f \u5f3a\u8feb\u7528\u6237\u4e0b\u6b21\u767b\u5f55\u65f6\u4fee\u6539\u53e3\u4ee4\u3002<\/li>\n<\/ul>\n

                  \u5982\u679c\u9ed8\u8ba4\u7528\u6237\u540d\uff0c\u5219\u4fee\u6539\u5f53\u524d\u7528\u6237\u7684\u53e3\u4ee4\u3002<\/p>\n

                  \u4f8b\u5982\uff0c\u5047\u8bbe\u5f53\u524d\u7528\u6237\u662fsam\uff0c\u5219\u4e0b\u9762\u7684\u547d\u4ee4\u4fee\u6539\u8be5\u7528\u6237\u81ea\u5df1\u7684\u53e3\u4ee4\uff1a<\/p>\n

                  $ passwd \nOld password:****** \nNew password:******* \nRe-enter new password:*******<\/code><\/pre>\n

                  \u5982\u679c\u662f\u8d85\u7ea7\u7528\u6237\uff0c\u53ef\u4ee5\u7528\u4e0b\u5217\u5f62\u5f0f\u6307\u5b9a\u4efb\u4f55\u7528\u6237\u7684\u53e3\u4ee4\uff1a<\/p>\n

                  # passwd sam \nNew password:******* \nRe-enter new password:*******<\/code><\/pre>\n

                  \u666e\u901a\u7528\u6237\u4fee\u6539\u81ea\u5df1\u7684\u53e3\u4ee4\u65f6\uff0cpasswd\u547d\u4ee4\u4f1a\u5148\u8be2\u95ee\u539f\u53e3\u4ee4\uff0c\u9a8c\u8bc1\u540e\u518d\u8981\u6c42\u7528\u6237\u8f93\u5165\u4e24\u904d\u65b0\u53e3\u4ee4\uff0c\u5982\u679c\u4e24\u6b21\u8f93\u5165\u7684\u53e3\u4ee4\u4e00\u81f4\uff0c\u5219\u5c06\u8fd9\u4e2a\u53e3\u4ee4\u6307\u5b9a\u7ed9\u7528\u6237\uff1b\u800c\u8d85\u7ea7\u7528\u6237\u4e3a\u7528\u6237\u6307\u5b9a\u53e3\u4ee4\u65f6\uff0c\u5c31\u4e0d\u9700\u8981\u77e5\u9053\u539f\u53e3\u4ee4\u3002<\/p>\n

                  \u4e3a\u4e86\u7cfb\u7edf\u5b89\u5168\u8d77\u89c1\uff0c\u7528\u6237\u5e94\u8be5\u9009\u62e9\u6bd4\u8f83\u590d\u6742\u7684\u53e3\u4ee4\uff0c\u4f8b\u5982\u6700\u597d\u4f7f\u75288\u4f4d\u957f\u7684\u53e3\u4ee4\uff0c\u53e3\u4ee4\u4e2d\u5305\u542b\u6709\u5927\u5199\u3001\u5c0f\u5199\u5b57\u6bcd\u548c\u6570\u5b57\uff0c\u5e76\u4e14\u5e94\u8be5\u4e0e\u59d3\u540d\u3001\u751f\u65e5\u7b49\u4e0d\u76f8\u540c\u3002<\/p>\n

                  \u4e3a\u7528\u6237\u6307\u5b9a\u7a7a\u53e3\u4ee4\u65f6\uff0c\u6267\u884c\u4e0b\u5217\u5f62\u5f0f\u7684\u547d\u4ee4\uff1a<\/p>\n

                  # passwd -d sam<\/code><\/pre>\n

                  \u6b64\u547d\u4ee4\u5c06\u7528\u6237sam\u7684\u53e3\u4ee4\u5220\u9664\uff0c\u8fd9\u6837\u7528\u6237sam\u4e0b\u4e00\u6b21\u767b\u5f55\u65f6\uff0c\u7cfb\u7edf\u5c31\u4e0d\u518d\u8be2\u95ee\u53e3\u4ee4\u3002<\/p>\n

                  passwd\u547d\u4ee4\u8fd8\u53ef\u4ee5\u7528-l(lock)\u9009\u9879\u9501\u5b9a\u67d0\u4e00\u7528\u6237\uff0c\u4f7f\u5176\u4e0d\u80fd\u767b\u5f55\uff0c\u4f8b\u5982\uff1a<\/p>\n

                  # passwd -l sam<\/code><\/pre>\n

                  \u5229\u7528\u7ec4\u6765\u7b80\u5316\u6388\u6743\u64cd\u4f5c\uff0c\u5f53\u5bf9\u6574\u4e2a\u7ec4\u6388\u6743\u65f6\uff0c\u6574\u4e2a\u7ec4\u4e0b\u7684\u8d26\u53f7\u6743\u9650\u90fd\u4f1a\u8fdb\u884c\u4fee\u6539<\/p>\n

                  \u5176\u4ed6 : \u7528\u6237\u76f8\u5173\u7684\u5176\u4ed6\u6307\u4ee4<\/p>\n

                  chfn [USER] \u4fee\u6539\u7528\u6237\u7684\u5907\u6ce8\u6587\u6863<\/p>\n

                  chsh [Shell] \u4fee\u6539\u7528\u6237\u7684\u6307\u5b9ashell<\/p>\n

                  3.\u7528\u6237\u7ec4<\/p>\n

                  3.\u7528\u6237\u7ec4\u7684\u7ba1\u7406<\/h1>\n

                  \u6bcf\u4e2a\u7528\u6237\u90fd\u6709\u4e00\u4e2a\u7528\u6237\u7ec4\uff0c\u7cfb\u7edf\u53ef\u4ee5\u5bf9\u4e00\u4e2a\u7528\u6237\u7ec4\u4e2d\u7684\u6240\u6709\u7528\u6237\u8fdb\u884c\u96c6\u4e2d\u7ba1\u7406<\/strong>\u3002\u4e0d\u540cLinux \u7cfb\u7edf\u5bf9\u7528\u6237\u7ec4\u7684\u89c4\u5b9a\u6709\u6240\u4e0d\u540c\uff0c\u5982Linux\u4e0b\u7684\u7528\u6237\u5c5e\u4e8e\u4e0e\u5b83\u540c\u540d\u7684\u7528\u6237\u7ec4\uff0c\u8fd9\u4e2a\u7528\u6237\u7ec4\u5728\u521b\u5efa\u7528\u6237\u65f6\u540c\u65f6\u521b\u5efa\u3002<\/p>\n

                  \u7528\u6237\u7ec4\u7684\u7ba1\u7406\u6d89\u53ca\u7528\u6237\u7ec4\u7684\u6dfb\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u3002\u7ec4\u7684\u589e\u52a0\u3001\u5220\u9664\u548c\u4fee\u6539\u5b9e\u9645\u4e0a\u5c31\u662f\u5bf9\/etc\/group\u6587\u4ef6\u7684\u66f4\u65b0\u3002<\/p>\n

                  3.1\u589e\u52a0\u7ec4<\/h2>\n

                  1\u3001\u589e\u52a0\u4e00\u4e2a\u65b0\u7684\u7528\u6237\u7ec4\u4f7f\u7528groupadd\u547d\u4ee4\u3002\u5176\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

                  groupadd \u9009\u9879 \u7528\u6237\u7ec4<\/code><\/pre>\n

                  \u53ef\u4ee5\u4f7f\u7528\u7684\u9009\u9879\u6709\uff1a<\/p>\n

                    \n
                  • -g GID \u6307\u5b9a\u65b0\u7528\u6237\u7ec4\u7684\u7ec4\u6807\u8bc6\u53f7\uff08GID\uff09\u3002<\/li>\n
                  • -o \u4e00\u822c\u4e0e-g\u9009\u9879\u540c\u65f6\u4f7f\u7528\uff0c\u8868\u793a\u65b0\u7528\u6237\u7ec4\u7684GID\u53ef\u4ee5\u4e0e\u7cfb\u7edf\u5df2\u6709\u7528\u6237\u7ec4\u7684GID\u76f8\u540c\u3002<\/li>\n
                  • -r \u521b\u5efa\u7cfb\u7edf\u7ec4<\/li>\n<\/ul>\n

                    \u5b9e\u4f8b1\uff1a<\/h4>\n
                    # groupadd group1<\/code><\/pre>\n

                    \u6b64\u547d\u4ee4\u5411\u7cfb\u7edf\u4e2d\u589e\u52a0\u4e86\u4e00\u4e2a\u65b0\u7ec4group1\uff0c\u65b0\u7ec4\u7684\u7ec4\u6807\u8bc6\u53f7\u662f\u5728\u5f53\u524d\u5df2\u6709\u7684\u6700\u5927\u7ec4\u6807\u8bc6\u53f7\u7684\u57fa\u7840\u4e0a\u52a01\u3002<\/p>\n

                    \u5b9e\u4f8b2\uff1a<\/h4>\n
                    # groupadd -g 101 group2<\/code><\/pre>\n

                    \u6b64\u547d\u4ee4\u5411\u7cfb\u7edf\u4e2d\u589e\u52a0\u4e86\u4e00\u4e2a\u65b0\u7ec4group2\uff0c\u540c\u65f6\u6307\u5b9a\u65b0\u7ec4\u7684\u7ec4\u6807\u8bc6\u53f7\u662f101\u3002<\/p>\n

                    3.2 \u5220\u9664\u7ec4<\/h2>\n

                    2\u3001\u5982\u679c\u8981\u5220\u9664\u4e00\u4e2a\u5df2\u6709\u7684\u7528\u6237\u7ec4\uff0c\u4f7f\u7528groupdel\u547d\u4ee4\uff0c\u5176\u683c\u5f0f\u5982\u4e0b\uff1a<\/p>\n

                    groupdel \u7528\u6237\u7ec4<\/code><\/pre>\n

                    \u4f8b\u5982\uff1a<\/h4>\n
                    # groupdel group1<\/code><\/pre>\n

                    \u6b64\u547d\u4ee4\u4ece\u7cfb\u7edf\u4e2d\u5220\u9664\u7ec4group1\u3002\u8981\u60f3\u5220\u9664\u7ec4\uff0c\u8981\u786e\u4fdd\u8be5\u7ec4\u4e0d\u662f\u4e3b\u7ec4\uff0c\u624d\u80fd\u628a\u8fd9\u4e2a\u7ec4\u5220\u6389\u3002<\/strong><\/p>\n

                    3.3 \u4fee\u6539\u7ec4<\/h3>\n

                    3\u3001\u4fee\u6539\u7528\u6237\u7ec4\u7684\u5c5e\u6027\u4f7f\u7528groupmod\u547d\u4ee4\u3002\u5176\u8bed\u6cd5\u5982\u4e0b\uff1a<\/p>\n

                    groupmod \u9009\u9879 \u7528\u6237\u7ec4<\/code><\/pre>\n

                    \u5e38\u7528\u7684\u9009\u9879\u6709\uff1a<\/p>\n

                      \n
                    • -g GID \u4e3a\u7528\u6237\u7ec4\u6307\u5b9a\u65b0\u7684\u7ec4\u6807\u8bc6\u53f7\u3002<\/li>\n
                    • -o \u4e0e-g\u9009\u9879\u540c\u65f6\u4f7f\u7528\uff0c\u7528\u6237\u7ec4\u7684\u65b0GID\u53ef\u4ee5\u4e0e\u7cfb\u7edf\u5df2\u6709\u7528\u6237\u7ec4\u7684GID\u76f8\u540c\u3002<\/li>\n
                    • -n\u65b0\u7528\u6237\u7ec4 \u5c06\u7528\u6237\u7ec4\u7684\u540d\u5b57\u6539\u4e3a\u65b0\u540d\u5b57<\/li>\n<\/ul>\n

                      \u5b9e\u4f8b1\uff1a<\/h4>\n
                      # groupmod -g 102 group2<\/code><\/pre>\n

                      \u6b64\u547d\u4ee4\u5c06\u7ec4group2\u7684\u7ec4\u6807\u8bc6\u53f7\u4fee\u6539\u4e3a102\u3002<\/p>\n

                      \u5b9e\u4f8b2\uff1a<\/h4>\n
                      # groupmod \u2013g 10000 -n group3 group2<\/code><\/pre>\n

                      \u6b64\u547d\u4ee4\u5c06\u7ec4group2\u7684\u6807\u8bc6\u53f7\u6539\u4e3a10000\uff0c\u7ec4\u540d\u4fee\u6539\u4e3agroup3\u3002<\/p>\n

                      3.4 \u5207\u6362\u7ec4(\u4e34\u65f6\u5207\u6362\u4e3b\u7ec4)<\/h3>\n

                      4\u3001\u5982\u679c\u4e00\u4e2a\u7528\u6237\u540c\u65f6\u5c5e\u4e8e\u591a\u4e2a\u7528\u6237\u7ec4\uff0c\u90a3\u4e48\u7528\u6237\u53ef\u4ee5\u5728\u7528\u6237\u7ec4\u4e4b\u95f4\u5207\u6362\uff0c\u4ee5\u4fbf\u5177\u6709\u5176\u4ed6\u7528\u6237\u7ec4\u7684\u6743\u9650\u3002<\/p>\n

                      \u7528\u6237\u53ef\u4ee5\u5728\u767b\u5f55\u540e\uff0c\u4f7f\u7528\u547d\u4ee4newgrp\u5207\u6362\u5230\u5176\u4ed6\u7528\u6237\u7ec4\uff0c\u8fd9\u4e2a\u547d\u4ee4\u7684\u53c2\u6570\u5c31\u662f\u76ee\u7684\u7528\u6237\u7ec4\u3002\u4f8b\u5982\uff1a<\/p>\n

                      $ newgrp root<\/code><\/pre>\n

                      \u8fd9\u6761\u547d\u4ee4\u5c06\u5f53\u524d\u7528\u6237\u5207\u6362\u5230root\u7528\u6237\u7ec4\uff0c\u524d\u63d0\u6761\u4ef6\u662froot\u7528\u6237\u7ec4\u786e\u5b9e\u662f\u8be5\u7528\u6237\u7684\u4e3b\u7ec4\u6216\u9644\u52a0\u7ec4\u3002\u7c7b\u4f3c\u4e8e\u7528\u6237\u8d26\u53f7\u7684\u7ba1\u7406\uff0c\u7528\u6237\u7ec4\u7684\u7ba1\u7406\u4e5f\u53ef\u4ee5\u901a\u8fc7\u96c6\u6210\u7684\u7cfb\u7edf\u7ba1\u7406\u5de5\u5177\u6765\u5b8c\u6210\u3002<\/p>\n

                      3.5 \u66f4\u6539\u67e5\u770b\u7ec4\u6210\u5458<\/p>\n

                      5 \u3001\u53ef\u4ee5\u901a\u8fc7\u4ee5\u4e0b\u547d\u4ee4\uff0c\u6765\u66f4\u6539\u548c\u67e5\u770b\u7ec4\u4e2d\u7684\u6210\u5458<\/p>\n

                       #groupmems [opentions] [action]<\/code><\/pre>\n

                      \u53c2\u6570\u5982\u4e0b:<\/p>\n

                        \n
                      • -g \u66f4\u6539\u4e3a\u6307\u5b9a\u7ec4\uff08\u53ea\u6709root\u53ef\u4ee5\u4f7f\u7528\uff09<\/li>\n
                      • -a \u6307\u5b9a\u7528\u6237\u52a0\u5165\u7ec4<\/li>\n
                      • -d \u4ece\u7ec4\u4e2d\u5220\u9664\u8be5\u7528\u6237<\/li>\n
                      • -p \u4ece\u7ec4\u4e2d\u6e05\u695a\u6240\u6709\u6210\u5458<\/li>\n
                      • -l \u663e\u793a\u7ec4\u6210\u5458\u5217\u8868<\/li>\n<\/ul>\n

                        \u5b9e\u4f8b1<\/h4>\n
                        $groupmems -l -g root<\/code><\/pre>\n

                        \u6b64\u547d\u4ee4\u8868\u793a\u67e5\u770broot\u7ec4\u4e2d\u5b58\u5728\u7684\u6210\u5458\u3002<\/p>\n

                        \u5b9e\u4f8b2<\/h4>\n

                        $groupmems -a Father -g root<\/p>\n

                        \u6b64\u547d\u4ee4\u8868\u793a\u5c06Father\u7528\u6237\u52a0\u5165root\u7ec4\u4e2d\u3002<\/p>\n

                        \u5c0f\u6280\u5de7:<\/p>\n

                          \n
                        • \u4e00\u4e2a\u7528\u6237\u53ef\u4ee5\u52a0\u5165\u4e0d\u540c\u7684\u7ec4\uff0c\u4f46\u662f\u6709\u4e14\u53ea\u6709\u4e00\u4e2a\u4e3b\u7ec4\u3002<\/li>\n
                        • \u4e00\u4e2a\u7528\u6237\u7684\u6743\u9650\u4e3a\u4ed6\u6240\u5c5e\u7684\u591a\u4e2a\u7ec4\u7684\u7d2f\u52a0\u6743\u9650 \u3002\u5047\u8bbeuser\u8d26\u6237\u9644\u52a0\u7ec4group1 = write group2 = read \uff0c\u90a3\u4e48user\u5c31\u62e5\u6709 write + read\u6743\u9650\u3002<\/li>\n
                        • \u7ec4\u548c\u7528\u6237\u7684\u5173\u7cfb\u662f\u591a\u5bf9\u591a \u4e00\u4e2a\u7528\u6237\u53ef\u4ee5\u6709\u591a\u4e2a\u7ec4\uff0c\u4e00\u4e2a\u7ec4\u4e5f\u53ef\u4ee5\u6709\u591a\u4e2a\u7528\u6237\u3002<\/li>\n
                        • \u5728windows\u4e2d\uff0c\u53ea\u6709\u7ba1\u7406\u5458\u624d\u5141\u8bb8\u5bf9\u7528\u6237\u7ec4\u8fdb\u884c\u64cd\u4f5c\uff0c\u4f46\u5728Linux\u4e2d\uff0c\u53ea\u8981\u6709\u7ec4\u7684\u53e3\u4ee4\uff0c\u5c31\u53ef\u4ee5\u8ba9\u8d26\u53f7\u8fdb\u5165\u7ec4\u3002<\/li>\n
                        • root\u7ec4\u7684\u6743\u9650\u4e0e\u666e\u901a\u7ec4\u6743\u9650\u5927\u81f4\u76f8\u540c\uff01\uff01\u8d26\u53f7\u5e76\u4e0d\u662f\u52a0\u5165root\u7ec4\u5c31\u80fd\u83b7\u5f97\u7528\u6237\u6743\u9650\uff01<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"

                          Linux\u4e2d\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406 \u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/www.cnblogs.com\/ddz-linux\/p<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[17],"tags":[],"yoast_head":"\n02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\" \/>\n<meta property=\"og:description\" content=\"Linux\u4e2d\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406 \u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/www.cnblogs.com\/ddz-linux\/p\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/\" \/>\n<meta property=\"og:site_name\" content=\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\" \/>\n<meta property=\"article:published_time\" content=\"2021-05-18T05:46:17+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2021-05-18T05:47:20+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/gitee.com\/wangfeng-1\/images\/raw\/master\/1612727-20190303194107865-105521093.png\" \/>\n<meta name=\"author\" content=\"\u7ba1\u7406\u5458\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/\"},\"author\":{\"name\":\"\u7ba1\u7406\u5458\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"headline\":\"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406\",\"datePublished\":\"2021-05-18T05:46:17+00:00\",\"dateModified\":\"2021-05-18T05:47:20+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/\"},\"wordCount\":199,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"articleSection\":[\"Linux\"],\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/\",\"name\":\"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\",\"isPartOf\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\"},\"datePublished\":\"2021-05-18T05:46:17+00:00\",\"dateModified\":\"2021-05-18T05:47:20+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/#breadcrumb\"},\"inLanguage\":\"zh-CN\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/www.linuxdevops.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Linux\",\"item\":\"https:\/\/www.linuxdevops.cn\/linux\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#website\",\"url\":\"https:\/\/www.linuxdevops.cn\/\",\"name\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\",\"description\":\"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0\",\"publisher\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\"},\"alternateName\":\"linuxdevops\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.linuxdevops.cn\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"zh-CN\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1\",\"name\":\"\u7ba1\u7406\u5458\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-CN\",\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"contentUrl\":\"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg\",\"width\":512,\"height\":512,\"caption\":\"\u7ba1\u7406\u5458\"},\"logo\":{\"@id\":\"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/\"},\"description\":\"\u7ba1\u7406\u5458\",\"url\":\"https:\/\/www.linuxdevops.cn\/author\/root\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/","og_locale":"zh_CN","og_type":"article","og_title":"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","og_description":"Linux\u4e2d\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406 \u539f\u6587\u94fe\u63a5\uff1ahttps:\/\/www.cnblogs.com\/ddz-linux\/p","og_url":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/","og_site_name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","article_published_time":"2021-05-18T05:46:17+00:00","article_modified_time":"2021-05-18T05:47:20+00:00","og_image":[{"url":"https:\/\/gitee.com\/wangfeng-1\/images\/raw\/master\/1612727-20190303194107865-105521093.png"}],"author":"\u7ba1\u7406\u5458","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/#article","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/"},"author":{"name":"\u7ba1\u7406\u5458","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"headline":"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406","datePublished":"2021-05-18T05:46:17+00:00","dateModified":"2021-05-18T05:47:20+00:00","mainEntityOfPage":{"@id":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/"},"wordCount":199,"commentCount":0,"publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"articleSection":["Linux"],"inLanguage":"zh-CN","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/","url":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/","name":"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406 - Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","isPartOf":{"@id":"https:\/\/www.linuxdevops.cn\/#website"},"datePublished":"2021-05-18T05:46:17+00:00","dateModified":"2021-05-18T05:47:20+00:00","breadcrumb":{"@id":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/#breadcrumb"},"inLanguage":"zh-CN","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.linuxdevops.cn\/2021\/05\/02-linux-basic-course-user-and-user-group-management\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/www.linuxdevops.cn\/"},{"@type":"ListItem","position":2,"name":"Linux","item":"https:\/\/www.linuxdevops.cn\/linux\/"},{"@type":"ListItem","position":3,"name":"02-Linux \u57fa\u7840\u6559\u7a0b-\u7528\u6237\u4e0e\u7528\u6237\u7ec4\u7ba1\u7406"}]},{"@type":"WebSite","@id":"https:\/\/www.linuxdevops.cn\/#website","url":"https:\/\/www.linuxdevops.cn\/","name":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4","description":"Linux\u81ea\u52a8\u5316\u8fd0\u7ef4\u7b14\u8bb0","publisher":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1"},"alternateName":"linuxdevops","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.linuxdevops.cn\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"zh-CN"},{"@type":["Person","Organization"],"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/3e206335d5796fdd8679e449df72a0d1","name":"\u7ba1\u7406\u5458","image":{"@type":"ImageObject","inLanguage":"zh-CN","@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/","url":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","contentUrl":"https:\/\/www.linuxdevops.cn\/wp-content\/uploads\/2019\/07\/cropped-index.jpg","width":512,"height":512,"caption":"\u7ba1\u7406\u5458"},"logo":{"@id":"https:\/\/www.linuxdevops.cn\/#\/schema\/person\/image\/"},"description":"\u7ba1\u7406\u5458","url":"https:\/\/www.linuxdevops.cn\/author\/root\/"}]}},"_links":{"self":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/1068"}],"collection":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/comments?post=1068"}],"version-history":[{"count":2,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/1068\/revisions"}],"predecessor-version":[{"id":1070,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/posts\/1068\/revisions\/1070"}],"wp:attachment":[{"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/media?parent=1068"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/categories?post=1068"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxdevops.cn\/wp-json\/wp\/v2\/tags?post=1068"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}