{"id":1574,"date":"2016-08-01T17:15:32","date_gmt":"2016-08-01T14:15:32","guid":{"rendered":"http:\/\/www.systemcodegeeks.com\/?p=1574"},"modified":"2017-12-04T15:56:16","modified_gmt":"2017-12-04T13:56:16","slug":"linux-add-user-group-example","status":"publish","type":"post","link":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/","title":{"rendered":"Linux Add User to Group Example"},"content":{"rendered":"<p>In this tutorial we will see how to add users to groups in Linux, looking at the different possibilities (existing or non-existing users), and taking into account also the different types of groups users can belong to (primary and secondary groups).<\/p>\n<p>For this example, Linux Mint 17.03 has been used.<\/p>\n<h2>1. How groups are organized<\/h2>\n<p>Linux defines the groups in the file <code>\/etc\/group<\/code>. If we open it, we will see many rows, with the following format:<\/p>\n<pre class=\"brush:bash\">adm:x:4:syslog,julen<\/pre>\n<p>[ulp id=&#8217;SG9vnnKgRCD7iZxf&#8217;]<br \/>\n&nbsp;<br \/>\nWhich follows this format:<\/p>\n<pre class=\"brush:bash\">group_name:password:gid:user1,user2,...,userN<\/pre>\n<ul>\n<li>The <code>group_name<\/code> is the name we give to the group when we create it with <code>groupadd<\/code>.<\/li>\n<li>The <code>password<\/code> is optional. Really, this is almost never used.<\/li>\n<li>The <code>gid<\/code> (group identifier) is the numerical identifier that each group has.<\/li>\n<li>Finally, the members of the group are listed.<\/li>\n<\/ul>\n<p>It is possible to modify this file manually, but also dangerous, since it can become corrupt. In any case, there is available a tool for checking the integrity of this file, called <code>grpck<\/code>. To use it, just execute it with <code>sudo<\/code> permissions. If the file is correct, no message will be shown. <strong>In any case, is not recommendable to modify it manually<\/strong>.<\/p>\n<p>It is necessary to know that Linux distinguishes two types of groups for a user: the primary, and secondaries. The primary group is the one used when the user creates files and directories. Let&#8217;s suppose that we have a user named <code>john_doe<\/code>, whose primary group is <code>developers<\/code>, but that is enrolled also in a group called <code>testers<\/code>. Every file created by him:<\/p>\n<pre class=\"brush:bash\">touch foo<\/pre>\n<p>Will be created with with <code>developers<\/code> as the owner group:<\/p>\n<pre class=\"brush:bash\">-rw-r--r-- 1 john_doe developers 0 jul 27 12:03 foo<\/pre>\n<p>To see to which groups a user belongs to, we can use the <code>groups<\/code> command, specifying the user name:<\/p>\n<pre class=\"brush:bash\">groups &lt;username&gt;<\/pre>\n<p>Which will return an output with the following format:<\/p>\n<pre class=\"brush:bash\">&lt;username&gt; : &lt;primary_group&gt;[&lt;secondary_group1&gt;,...,&lt;secondary_groupN&gt;]<\/pre>\n<p>That is, the primary group will be the first of the list (or the unique, if the user does not belong to more groups).<\/p>\n<h2>2. Non-existing users<\/h2>\n<p>When we are going to create a new user, with <code>useradd<\/code>, we can specify its group(s), so we can create users and assign groups to it with one command.<\/p>\n<h3>2.1. Primary group<\/h3>\n<p>The primary group is configured with\u00a0<code>-g<\/code> (<code>--gid<\/code>) option. For example, to create a <code>john_doe<\/code> user with the <code>developers<\/code> group as primary, we would have to type:<\/p>\n<pre class=\"brush:bash\">sudo useradd john_doe -g developers<\/pre>\n<p>(Remember to always assign a password to each new user, with <code>passwd<\/code> command.)<\/p>\n<p>We can check that it has been created as expected, using <code>groups<\/code> command:<\/p>\n<pre class=\"brush:bash\">groups john_doe<\/pre>\n<p>Which would return:<\/p>\n<pre class=\"brush:bash\">john_doe : developers<\/pre>\n<h4>2.1.1. Changing default configuration of primary group assignment<\/h4>\n<p>If no primary group is specified, the assignation of the primary group will depend on the configuration defined in <code>\/etc\/login.defs<\/code>. If the variable <code>USERGROUP_ENAB<\/code> is set to <code>yes<\/code>, the primary group of the user will be a new group with the same name as the username. If the variable is set to <code>no<\/code>, the primary group of the user will be the one specified in <code>\/etc\/default\/useradd<\/code>, in the <code>GROUP<\/code> variable.<\/p>\n<p>So, if we assume that every user created in the future has to have a specific group as primary, e.g., <code>developers<\/code>, we first have to edit the <code>\/etc\/login.defs<\/code> file:<\/p>\n<pre class=\"brush:bash\">USERGROUP_ENAB no<\/pre>\n<p>The second and last step is to specify the group in <code>\/etc\/default\/useradd<\/code> file:<\/p>\n<pre class=\"brush:bash\">GROUP=developers<\/pre>\n<h3>2.2. Secondary groups<\/h3>\n<p>The option for assigning secondary groups to the user that is going to be created is <code>-G<\/code> (<code>--groups<\/code>), specifying the list of groups separated by commas, without whitespaces. For example:<\/p>\n<pre class=\"brush:bash\">sudo useradd john_doe -G developers,testers<\/pre>\n<p>Would create the <code>john_doe<\/code> user, with <code>developers<\/code> and <code>testers<\/code> groups as secondary.<\/p>\n<pre class=\"brush:bash\">john_doe : john_doe developers testers<\/pre>\n<h2>3. Existing users<\/h2>\n<p>The <code>usermod<\/code> command, as its name suggests, is for modifying users, in all its facets, including their groups.<\/p>\n<p>For the modification of groups, it works exactly as with <code>useradd<\/code>: <code>-g<\/code> for modifying the primary group, and\u00a0<code>-G<\/code> for the secondary ones.<\/p>\n<h3>3.1. Primary group<\/h3>\n<p>Changing the primary group of an existing user is pretty simple, we just have to use the <code>-g<\/code> option for the <code>useradd<\/code>, as told before:<\/p>\n<pre class=\"brush:bash\">sudo usermod john_doe -g developers # Now primary group of 'john_doe' is 'developers'.<\/pre>\n<p>The manual of <code>useradd<\/code> warns about changing the primary group of a user:<\/p>\n<blockquote><p>Any file from the user&#8217;s home directory owned by the previous primary group of the user will be owned by this new group.<\/p>\n<p>The group ownership of files outside of the user&#8217;s home directory must be fixed manually.<\/p><\/blockquote>\n<p>This manual fixing for the whole disk can be easily done with <code>find<\/code>. Let&#8217;s suppose that we have changed <code>john_doe<\/code> user&#8217;s primary group from <code>john_doe<\/code> to <code>developers<\/code>, and that we want to change the owner of every file to this one. We could execute the following:<\/p>\n<pre class=\"brush:bash\">sudo find \/ -group john_doe -exec chgrp developers {} \\;<\/pre>\n<p>Finding every file in <code>\/<\/code> and subdirectories (i.e., all the disk) that has <code>john_doe<\/code> as group owner, executing for each result a <code>chgrp<\/code> to change to group owner to <code>developers<\/code>.<\/p>\n<h3>3.2. Secondary groups<\/h3>\n<p>Let&#8217;s suppose that we have a <code>john_doe<\/code> user with the following output for <code>groups<\/code>:<\/p>\n<pre class=\"brush:bash\">john_doe : john_doe<\/pre>\n<p>Now, we want to assign some groups, <code>developers<\/code> and <code>testers<\/code>, to the existing <code>john_doe<\/code> user. We would just have to execute the <code>usermod<\/code> command with the <code>-G<\/code> option, specifying the groups:<\/p>\n<pre class=\"brush:bash\">sudo usermod john_doe -G developers,testers<\/pre>\n<p>If we now check the groups with groups, we will see:<\/p>\n<pre class=\"brush:bash\">john_doe : john_doe developers testers<\/pre>\n<p>According to the manual of <code>usermod<\/code>, this is what happens when using <code>-G<\/code> option:<\/p>\n<blockquote><p>[&#8230;] If the user is currently a member of a group which is not listed, the user will be removed from the group. This behavior can be changed via the -a option, which appends the user to the current supplementary group list.<\/p><\/blockquote>\n<p>In the previous case, we can see that the group that <code>john_doe<\/code> was already belonging to (the primary), has not disappeared, but this is <strong>just because it was the primary group<\/strong>. Note that, with the current groups for <code>john_doe<\/code>, the following:<\/p>\n<pre class=\"brush:bash\">sudo usermod john_doe -G another_group<\/pre>\n<p><code>john_doe<\/code> would be removed from <code>developers<\/code> and <code>testers<\/code> groups:<\/p>\n<pre class=\"brush:bash\">john_doe : john_doe another_group<\/pre>\n<p>To append groups, use the <code>-a<\/code> (<code>--append<\/code>) option, as the manual suggests.<\/p>\n<h2>4. Giving users sudo permissions<\/h2>\n<p>Users are given <code>sudo<\/code> permissions by just being added to <code>sudo<\/code> group. So, the only thing we have to do is to add the users to <code>sudo<\/code> group, as same as we have been seeing in this example:<\/p>\n<pre class=\"brush:bash\">sudo useradd john_doe -G sudo    # At creation time.\r\nsudo usermod john_doe -G sudo -a # For existing user.<\/pre>\n<h2>5. Summary<\/h2>\n<p>This example has shown how to add users to groups, for both non-existing, and already existing users, taking into account also the differences between the primary group and the secondary ones, considering also the side effects of a primary group change, and proposing an easy fix to them.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this tutorial we will see how to add users to groups in Linux, looking at the different possibilities (existing or non-existing users), and taking into account also the different types of groups users can belong to (primary and secondary groups). For this example, Linux Mint 17.03 has been used. 1. How groups are organized &hellip;<\/p>\n","protected":false},"author":25,"featured_media":185,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[19],"tags":[74],"class_list":["post-1574","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-bash","tag-permissions"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v26.5 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Linux Add User to Group Example - System Code Geeks - 2026<\/title>\n<meta name=\"description\" content=\"In this tutorial we will see how to add users to groups in Linux, looking at the different possibilities (existing or non-existing users), and taking into\" \/>\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.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Linux Add User to Group Example - System Code Geeks - 2026\" \/>\n<meta property=\"og:description\" content=\"In this tutorial we will see how to add users to groups in Linux, looking at the different possibilities (existing or non-existing users), and taking into\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/\" \/>\n<meta property=\"og:site_name\" content=\"System Code Geeks\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/systemcodegeeks\" \/>\n<meta property=\"article:published_time\" content=\"2016-08-01T14:15:32+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-12-04T13:56:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"150\" \/>\n\t<meta property=\"og:image:height\" content=\"150\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"Toni\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@systemcodegeeks\" \/>\n<meta name=\"twitter:site\" content=\"@systemcodegeeks\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Toni\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"6 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/\"},\"author\":{\"name\":\"Toni\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/69a7de154310f99cedabb63c580291b2\"},\"headline\":\"Linux Add User to Group Example\",\"datePublished\":\"2016-08-01T14:15:32+00:00\",\"dateModified\":\"2017-12-04T13:56:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/\"},\"wordCount\":979,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"keywords\":[\"permissions\"],\"articleSection\":[\"BASH\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/\",\"name\":\"Linux Add User to Group Example - System Code Geeks - 2026\",\"isPartOf\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"datePublished\":\"2016-08-01T14:15:32+00:00\",\"dateModified\":\"2017-12-04T13:56:16+00:00\",\"description\":\"In this tutorial we will see how to add users to groups in Linux, looking at the different possibilities (existing or non-existing users), and taking into\",\"breadcrumb\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#primaryimage\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg\",\"width\":150,\"height\":150},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.systemcodegeeks.com\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Shell Scripting\",\"item\":\"https:\/\/www.systemcodegeeks.com\/category\/shell-scripting\/\"},{\"@type\":\"ListItem\",\"position\":3,\"name\":\"BASH\",\"item\":\"https:\/\/www.systemcodegeeks.com\/category\/shell-scripting\/bash\/\"},{\"@type\":\"ListItem\",\"position\":4,\"name\":\"Linux Add User to Group Example\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#website\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"name\":\"System Code Geeks\",\"description\":\"Operating System Developers Resource Center\",\"publisher\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#organization\",\"name\":\"Exelixis Media P.C.\",\"url\":\"https:\/\/www.systemcodegeeks.com\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"contentUrl\":\"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png\",\"width\":864,\"height\":246,\"caption\":\"Exelixis Media P.C.\"},\"image\":{\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/systemcodegeeks\",\"https:\/\/x.com\/systemcodegeeks\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/69a7de154310f99cedabb63c580291b2\",\"name\":\"Toni\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/21c1661474c78b4757355b8beef9ab1d14f490ee3a3e67392f4e618d36643d4c?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/21c1661474c78b4757355b8beef9ab1d14f490ee3a3e67392f4e618d36643d4c?s=96&d=mm&r=g\",\"caption\":\"Toni\"},\"url\":\"https:\/\/www.systemcodegeeks.com\/author\/julen-pardo\/\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Linux Add User to Group Example - System Code Geeks - 2026","description":"In this tutorial we will see how to add users to groups in Linux, looking at the different possibilities (existing or non-existing users), and taking into","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.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/","og_locale":"en_US","og_type":"article","og_title":"Linux Add User to Group Example - System Code Geeks - 2026","og_description":"In this tutorial we will see how to add users to groups in Linux, looking at the different possibilities (existing or non-existing users), and taking into","og_url":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/","og_site_name":"System Code Geeks","article_publisher":"https:\/\/www.facebook.com\/systemcodegeeks","article_published_time":"2016-08-01T14:15:32+00:00","article_modified_time":"2017-12-04T13:56:16+00:00","og_image":[{"width":150,"height":150,"url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","type":"image\/jpeg"}],"author":"Toni","twitter_card":"summary_large_image","twitter_creator":"@systemcodegeeks","twitter_site":"@systemcodegeeks","twitter_misc":{"Written by":"Toni","Est. reading time":"6 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#article","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/"},"author":{"name":"Toni","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/69a7de154310f99cedabb63c580291b2"},"headline":"Linux Add User to Group Example","datePublished":"2016-08-01T14:15:32+00:00","dateModified":"2017-12-04T13:56:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/"},"wordCount":979,"commentCount":0,"publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","keywords":["permissions"],"articleSection":["BASH"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/","url":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/","name":"Linux Add User to Group Example - System Code Geeks - 2026","isPartOf":{"@id":"https:\/\/www.systemcodegeeks.com\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#primaryimage"},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#primaryimage"},"thumbnailUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","datePublished":"2016-08-01T14:15:32+00:00","dateModified":"2017-12-04T13:56:16+00:00","description":"In this tutorial we will see how to add users to groups in Linux, looking at the different possibilities (existing or non-existing users), and taking into","breadcrumb":{"@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#primaryimage","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2016\/01\/bash-logo.jpg","width":150,"height":150},{"@type":"BreadcrumbList","@id":"https:\/\/www.systemcodegeeks.com\/shell-scripting\/bash\/linux-add-user-group-example\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.systemcodegeeks.com\/"},{"@type":"ListItem","position":2,"name":"Shell Scripting","item":"https:\/\/www.systemcodegeeks.com\/category\/shell-scripting\/"},{"@type":"ListItem","position":3,"name":"BASH","item":"https:\/\/www.systemcodegeeks.com\/category\/shell-scripting\/bash\/"},{"@type":"ListItem","position":4,"name":"Linux Add User to Group Example"}]},{"@type":"WebSite","@id":"https:\/\/www.systemcodegeeks.com\/#website","url":"https:\/\/www.systemcodegeeks.com\/","name":"System Code Geeks","description":"Operating System Developers Resource Center","publisher":{"@id":"https:\/\/www.systemcodegeeks.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.systemcodegeeks.com\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.systemcodegeeks.com\/#organization","name":"Exelixis Media P.C.","url":"https:\/\/www.systemcodegeeks.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/","url":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","contentUrl":"https:\/\/www.systemcodegeeks.com\/wp-content\/uploads\/2022\/06\/exelixis-logo.png","width":864,"height":246,"caption":"Exelixis Media P.C."},"image":{"@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/systemcodegeeks","https:\/\/x.com\/systemcodegeeks"]},{"@type":"Person","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/69a7de154310f99cedabb63c580291b2","name":"Toni","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.systemcodegeeks.com\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/21c1661474c78b4757355b8beef9ab1d14f490ee3a3e67392f4e618d36643d4c?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/21c1661474c78b4757355b8beef9ab1d14f490ee3a3e67392f4e618d36643d4c?s=96&d=mm&r=g","caption":"Toni"},"url":"https:\/\/www.systemcodegeeks.com\/author\/julen-pardo\/"}]}},"_links":{"self":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/1574","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/users\/25"}],"replies":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/comments?post=1574"}],"version-history":[{"count":0,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/posts\/1574\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media\/185"}],"wp:attachment":[{"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/media?parent=1574"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/categories?post=1574"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.systemcodegeeks.com\/wp-json\/wp\/v2\/tags?post=1574"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}