{"id":655,"date":"2026-08-06T21:38:00","date_gmt":"2026-08-06T12:38:00","guid":{"rendered":"https:\/\/www.marchboy.xyz\/wordpress\/archives\/655"},"modified":"2026-08-06T21:38:00","modified_gmt":"2026-08-06T12:38:00","slug":"usermod-ag%e3%81%ae-ag%e3%81%ae%e6%84%8f%e5%91%b3%e3%81%af%ef%bc%9f","status":"publish","type":"post","link":"https:\/\/www.marchboy.xyz\/wordpress\/archives\/655","title":{"rendered":"usermod -aG\u306e-aG\u306e\u610f\u5473\u306f\uff1f"},"content":{"rendered":"<h2>usermod \u30b3\u30de\u30f3\u30c9\u306e\u57fa\u672c<\/h2>\n<p>Linux \u306e\u30e6\u30fc\u30b6\u30fc\u7ba1\u7406\u306b\u4f7f\u308f\u308c\u308b <code>usermod<\/code> \u30b3\u30de\u30f3\u30c9\u306f\u3001\u65e2\u5b58\u306e\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u5909\u66f4\u3059\u308b\u305f\u3081\u306e\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3067\u3059\u3002\u4e2d\u3067\u3082\u30b0\u30eb\u30fc\u30d7\u3078\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u969b\u306b\u983b\u51fa\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u304c <strong>-aG<\/strong> \u3067\u3059\u3002<\/p>\n<h2>-a \u3068 -G \u306e\u305d\u308c\u305e\u308c\u306e\u610f\u5473<\/h2>\n<h3>-G\uff08Group\uff09\u30aa\u30d7\u30b7\u30e7\u30f3<\/h3>\n<p> <code>-G<\/code> \u306f\u300c\u30b5\u30d6\u30b0\u30eb\u30fc\u30d7\uff08\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\uff09\u3078\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u300d\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3059\u3002<br \/>\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u7d9a\u3051\u3066\u30ab\u30f3\u30de\u533a\u5207\u308a\u3067\u30b0\u30eb\u30fc\u30d7\u540d\u3092\u5217\u6319\u3057\u307e\u3059\u3002<\/p>\n<pre><code>usermod -G group1,group2 username<\/code><\/pre>\n<p>\u4e0a\u8a18\u306f <code>username<\/code> \u3092 <code>group1<\/code> \u3068 <code>group2<\/code> \u306e\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\u306b\u8a2d\u5b9a\u3057\u307e\u3059\u3002<\/p>\n<h3>-a\uff08append\uff09\u30aa\u30d7\u30b7\u30e7\u30f3<\/h3>\n<p> <code>-a<\/code> \u306f\u300c\u8ffd\u52a0\uff08append\uff09\u300d\u3092\u610f\u5473\u3057\u3001\u65e2\u5b58\u306e\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\u30ea\u30b9\u30c8\u306b\u65b0\u3057\u3044\u30b0\u30eb\u30fc\u30d7\u3092 <strong>\u4ed8\u3051\u8db3\u3059<\/strong> \u3053\u3068\u3092\u6307\u793a\u3057\u307e\u3059\u3002<\/p>\n<p>\u3053\u306e\u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u7121\u3044\u5834\u5408\u3001<code>-G<\/code> \u3067\u6307\u5b9a\u3057\u305f\u30b0\u30eb\u30fc\u30d7\u306e\u307f\u304c\u30e6\u30fc\u30b6\u30fc\u306e\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\u3068\u3057\u3066\u8a2d\u5b9a\u3055\u308c\u3001\u65e2\u5b58\u306e\u8a2d\u5b9a\u306f\u3059\u3079\u3066\u4e0a\u66f8\u304d\u3055\u308c\u307e\u3059\u3002<\/p>\n<h2>-aG \u3092\u7d44\u307f\u5408\u308f\u305b\u3066\u4f7f\u3046\u610f\u5473<\/h2>\n<p>\u5b9f\u52d9\u3067\u6700\u3082\u5b89\u5168\u304b\u3064\u4e00\u822c\u7684\u306b\u4f7f\u308f\u308c\u308b\u5f62\u306f <strong>\u300c-aG\u300d<\/strong> \u306e\u7d44\u307f\u5408\u308f\u305b\u3067\u3059\u3002<\/p>\n<ul>\n<li><strong>-a<\/strong> \u306b\u3088\u3063\u3066\u73fe\u5728\u6240\u5c5e\u3057\u3066\u3044\u308b\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\u306f\u4fdd\u6301\u3055\u308c\u307e\u3059\u3002<\/li>\n<li><strong>-G<\/strong> \u3067\u6307\u5b9a\u3057\u305f\u30b0\u30eb\u30fc\u30d7\u304c\u65b0\u305f\u306b\u8ffd\u52a0\u3055\u308c\u307e\u3059\u3002<\/li>\n<\/ul>\n<p>\u3053\u306e\u7d44\u307f\u5408\u308f\u305b\u306b\u3088\u308a\u3001\u8aa4\u3063\u3066\u4ed6\u306e\u30b0\u30eb\u30fc\u30d7\u304b\u3089\u30e6\u30fc\u30b6\u30fc\u3092\u5916\u3059\u30ea\u30b9\u30af\u3092\u9632\u3052\u307e\u3059\u3002<\/p>\n<h2>\u5b9f\u969b\u306e\u4f7f\u7528\u4f8b<\/h2>\n<p>\u4f8b\uff1a<code>alice<\/code> \u30e6\u30fc\u30b6\u30fc\u306b <code>docker<\/code> \u30b0\u30eb\u30fc\u30d7\u306e\u6a29\u9650\u3092\u4ed8\u4e0e\u3057\u305f\u3044\u5834\u5408<\/p>\n<pre><code>usermod -aG docker alice<\/code><\/pre>\n<p>\u3053\u306e\u30b3\u30de\u30f3\u30c9\u306e\u5b9f\u884c\u5f8c\u3001<code>alice<\/code> \u306f <code>docker<\/code> \u30b0\u30eb\u30fc\u30d7\u306b\u52a0\u3048\u3066\u3001\u65e2\u306b\u6240\u5c5e\u3057\u3066\u3044\u308b\u4ed6\u306e\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\uff08\u4f8b: <code>staff<\/code>\u3001<code>audio<\/code>\uff09\u3082\u5f15\u304d\u7d9a\u304d\u4fdd\u6301\u3057\u307e\u3059\u3002<\/p>\n<h2>\u3088\u304f\u3042\u308b\u8aa4\u89e3\u3068\u6ce8\u610f\u70b9<\/h2>\n<ul>\n<li><strong>-a \u3092\u4ed8\u3051\u5fd8\u308c\u308b\u3068\u4e0a\u66f8\u304d\u306b\u306a\u308b<\/strong>\uff1a<code>usermod -G docker alice<\/code> \u3068\u3060\u3051\u66f8\u304f\u3068\u3001<code>alice<\/code> \u306e\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\u306f <code>docker<\/code> \u3060\u3051\u306b\u7f6e\u304d\u63db\u308f\u308a\u307e\u3059\u3002<\/li>\n<li><strong>\u4e3b\u30b0\u30eb\u30fc\u30d7\u306f\u5909\u66f4\u3055\u308c\u306a\u3044<\/strong>\uff1a<code>-aG<\/code> \u306f\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\u306e\u307f\u3092\u5bfe\u8c61\u306b\u3057\u307e\u3059\u3002\u4e3b\u30b0\u30eb\u30fc\u30d7\u3092\u5909\u3048\u305f\u3044\u5834\u5408\u306f <code>-g<\/code> \u30aa\u30d7\u30b7\u30e7\u30f3\u3092\u4f7f\u7528\u3057\u307e\u3059\u3002<\/li>\n<li><strong>\u30b0\u30eb\u30fc\u30d7\u304c\u5b58\u5728\u3057\u306a\u3044\u3068\u30a8\u30e9\u30fc\u306b\u306a\u308b<\/strong>\uff1a\u6307\u5b9a\u3057\u305f\u30b0\u30eb\u30fc\u30d7\u304c <code>\/etc\/group<\/code> \u306b\u7121\u3044\u3068 <code>usermod<\/code> \u306f\u5931\u6557\u3057\u307e\u3059\u3002\u4e8b\u524d\u306b <code>groupadd<\/code> \u3067\u4f5c\u6210\u3057\u3066\u304f\u3060\u3055\u3044\u3002<\/li>\n<li><strong>\u5909\u66f4\u306f\u6b21\u56de\u306e\u30ed\u30b0\u30a4\u30f3\u304b\u3089\u6709\u52b9<\/strong>\uff1a\u73fe\u5728\u30ed\u30b0\u30a4\u30f3\u4e2d\u306e\u30b7\u30a7\u30eb\u3067\u306f\u65b0\u3057\u3044\u30b0\u30eb\u30fc\u30d7\u6a29\u9650\u304c\u53cd\u6620\u3055\u308c\u307e\u305b\u3093\u3002\u4e00\u5ea6\u30ed\u30b0\u30a2\u30a6\u30c8\u3057\u3001\u518d\u5ea6\u30ed\u30b0\u30a4\u30f3\u3059\u308b\u304b <code>newgrp<\/code> \u30b3\u30de\u30f3\u30c9\u3067\u5207\u308a\u66ff\u3048\u307e\u3059\u3002<\/li>\n<\/ul>\n<h2>\u307e\u3068\u3081<\/h2>\n<p><code>-aG<\/code> \u306f\u300c\u65e2\u5b58\u306e\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\u306f\u4fdd\u6301\u3057\u305f\u307e\u307e\u3001\u6307\u5b9a\u3057\u305f\u30b0\u30eb\u30fc\u30d7\u3092\u8ffd\u52a0\u3059\u308b\u300d\u305f\u3081\u306e\u5fc5\u9808\u30b3\u30f3\u30d3\u30cd\u30fc\u30b7\u30e7\u30f3\u3067\u3059\u3002<br \/>\u8aa4\u3063\u3066 <code>-a<\/code> \u3092\u7701\u304f\u3068\u3001\u30e6\u30fc\u30b6\u30fc\u304c\u6240\u5c5e\u3057\u3066\u3044\u305f\u3059\u3079\u3066\u306e\u88dc\u52a9\u30b0\u30eb\u30fc\u30d7\u304c\u5931\u308f\u308c\u308b\u5371\u967a\u304c\u3042\u308a\u307e\u3059\u3002<br \/>\u5b89\u5168\u306b\u6a29\u9650\u4ed8\u4e0e\u3092\u884c\u3046\u305f\u3081\u306b\u3001\u5e38\u306b <code>usermod -aG \u30b0\u30eb\u30fc\u30d7\u540d \u30e6\u30fc\u30b6\u30fc\u540d<\/code> \u306e\u5f62\u3067\u4f7f\u7528\u3057\u307e\u3057\u3087\u3046\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>usermod \u30b3\u30de\u30f3\u30c9\u306e\u57fa\u672c Linux \u306e\u30e6\u30fc\u30b6\u30fc\u7ba1\u7406\u306b\u4f7f\u308f\u308c\u308b usermod \u30b3\u30de\u30f3\u30c9\u306f\u3001\u65e2\u5b58\u306e\u30e6\u30fc\u30b6\u30fc\u30a2\u30ab\u30a6\u30f3\u30c8\u3092\u5909\u66f4\u3059\u308b\u305f\u3081\u306e\u30e6\u30fc\u30c6\u30a3\u30ea\u30c6\u30a3\u3067\u3059\u3002\u4e2d\u3067\u3082\u30b0\u30eb\u30fc\u30d7\u3078\u30e6\u30fc\u30b6\u30fc\u3092\u8ffd\u52a0\u3059\u308b\u969b\u306b\u983b\u51fa\u3059\u308b\u30aa\u30d7\u30b7\u30e7\u30f3\u304c &#8211; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[34],"tags":[],"class_list":["post-655","post","type-post","status-publish","format-standard","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/posts\/655","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/comments?post=655"}],"version-history":[{"count":0,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/posts\/655\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/media?parent=655"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/categories?post=655"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.marchboy.xyz\/wordpress\/wp-json\/wp\/v2\/tags?post=655"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}