{"id":1674,"date":"2019-04-29T23:34:24","date_gmt":"2019-04-29T15:34:24","guid":{"rendered":"https:\/\/www.linuxcool.com\/?p=1674"},"modified":"2022-05-11T17:12:15","modified_gmt":"2022-05-11T09:12:15","slug":"usermod","status":"publish","type":"post","link":"https:\/\/www.linuxcool.com\/usermod","title":{"rendered":"usermod\u547d\u4ee4 – \u4fee\u6539\u7528\u6237\u8d26\u53f7\u4fe1\u606f"},"content":{"rendered":"\n

usermod\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cuser modify\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u4fee\u6539\u7528\u6237\u8d26\u53f7\u4e2d\u7684\u5404\u9879\u53c2\u6570\u3002<\/p>\n\n\n\n

\u8bed\u6cd5\u683c\u5f0f\uff1a<\/strong>usermod [\u53c2\u6570] \u7528\u6237\u540d<\/p>\n\n\n\n

\u5e38\u7528\u53c2\u6570\uff1a<\/strong><\/p>\n\n\n\n

-c<\u5907\u6ce8><\/td>\u4fee\u6539\u7528\u6237\u8d26\u53f7\u7684\u5907\u6ce8\u6587\u5b57<\/td><\/tr>
-d<\u767b\u5165\u76ee\u5f55><\/td>\u4fee\u6539\u7528\u6237\u767b\u5165\u65f6\u7684\u5bb6\u76ee\u5f55<\/td><\/tr>
-e<\u6709\u6548\u671f\u9650><\/td>\u4fee\u6539\u8d26\u53f7\u7684\u6709\u6548\u671f\u9650<\/td><\/tr>
-f<\u7f13\u51b2\u5929\u6570><\/td>\u4fee\u6539\u5728\u5bc6\u7801\u8fc7\u671f\u540e\u591a\u5c11\u5929\u5373\u5173\u95ed\u8be5\u8d26\u53f7<\/td><\/tr>
-g<\u7fa4\u7ec4><\/td>\u4fee\u6539\u7528\u6237\u6240\u5c5e\u7684\u7fa4\u7ec4<\/td><\/tr>
-G<\u7fa4\u7ec4><\/td>\u4fee\u6539\u7528\u6237\u6240\u5c5e\u7684\u9644\u52a0\u7fa4\u7ec4<\/td><\/tr>
-l<\u8d26\u53f7\u540d\u79f0><\/td>\u4fee\u6539\u7528\u6237\u8d26\u53f7\u540d\u79f0<\/td><\/tr>
-L<\/td>\u9501\u5b9a\u7528\u6237\u5bc6\u7801\uff0c\u4f7f\u5bc6\u7801\u65e0\u6548<\/td><\/tr>
-s<shell><\/td>\u4fee\u6539\u7528\u6237\u767b\u5165\u540e\u6240\u4f7f\u7528\u7684shell<\/td><\/tr>
-u<uid><\/td>\u4fee\u6539\u7528\u6237ID<\/td><\/tr>
-U<\/td>\u89e3\u9664\u5bc6\u7801\u9501\u5b9a<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n

\u53c2\u8003\u5b9e\u4f8b<\/strong><\/p>\n\n\n\n

\u4fee\u6539\u6307\u5b9a\u7528\u6237\u7684\u5bb6\u76ee\u5f55\u8def\u5f84\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# usermod -d \/home linuxprobe<\/strong><\/pre>\n\n\n\n

\u4fee\u6539\u6307\u5b9a\u7528\u6237\u7684UID\u53f7\u7801\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# usermod -u 6688 linuxprobe<\/strong><\/pre>\n\n\n\n

\u4fee\u6539\u6307\u5b9a\u7528\u6237\u7684\u540d\u79f0\u4e3alinuxcool\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# usermod -l linuxcool linuxprobe<\/strong>\r<\/pre>\n\n\n\n

\u9501\u5b9a\u6307\u5b9a\u7528\u6237\u7684\u8d26\u6237\uff0c\u4e34\u65f6\u4e0d\u5141\u8bb8\u767b\u5f55\u7cfb\u7edf\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# usermod -L linuxcool<\/strong><\/pre>\n\n\n\n

\u89e3\u9501\u6307\u5b9a\u7528\u6237\u7684\u8d26\u6237\uff0c\u518d\u6b21\u5141\u8bb8\u767b\u5f55\u7cfb\u7edf\uff1a<\/p>\n\n\n\n

[root@linuxcool ~]# usermod -U linuxcool<\/strong><\/pre>\n","protected":false},"excerpt":{"rendered":"

usermod\u547d\u4ee4\u6765\u81ea\u4e8e\u82f1\u6587\u8bcd\u7ec4\u201cuser modify\u201d\u7684\u7f29\u5199\uff0c\u5176\u529f\u80fd\u662f\u7528\u4e8e\u4fee\u6539\u7528\u6237\u8d26\u53f7\u4e2d\u7684\u5404\u9879\u53c2\u6570\u3002 \u8bed\u6cd5 […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":[],"categories":[7],"tags":[],"_links":{"self":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1674"}],"collection":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/comments?post=1674"}],"version-history":[{"count":10,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1674\/revisions"}],"predecessor-version":[{"id":9513,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/posts\/1674\/revisions\/9513"}],"wp:attachment":[{"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/media?parent=1674"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/categories?post=1674"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linuxcool.com\/wp-json\/wp\/v2\/tags?post=1674"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}