{"id":12731,"date":"2022-09-29T22:58:47","date_gmt":"2022-09-29T17:28:47","guid":{"rendered":"https:\/\/codeforgeek.com\/?p=12731"},"modified":"2022-09-29T23:09:24","modified_gmt":"2022-09-29T17:39:24","slug":"create-a-user-in-linux-useradd-command","status":"publish","type":"post","link":"https:\/\/codeforgeek.com\/create-a-user-in-linux-useradd-command\/","title":{"rendered":"How to Create a User in Linux Using the useradd Command"},"content":{"rendered":"\n<p><strong>There are multiple ways to create a user in Linux<\/strong>. The most common way is to use the <a href=\"https:\/\/www.linuxfordevices.com\/tutorials\/linux\/useradd-command\" data-type=\"post\" data-id=\"20130\" target=\"_blank\" rel=\"noopener\">useradd command<\/a>. This command will add a new user to the system and create their home directory. In this article, let&#8217;s explore the useradd command in detail and understand the process of user creation in Linux.<\/p>\n\n\n\n<p><strong><em>Also read: <a href=\"https:\/\/codeforgeek.com\/reading-and-writing-json-to-a-file-in-python\/\" data-type=\"post\" data-id=\"7616\">Reading and Writing JSON to a File in Python<\/a><\/em><\/strong><\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Create a user in Linux with useradd<\/h2>\n\n\n\n<p>To use the <strong>useradd command<\/strong>, you must be logged in as root or have sudo privileges. Then, you can run the following command to add a new user:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nuseradd &#x5B;username]\n<\/pre><\/div>\n\n\n<p>Substitute [username] with the name of the user you want to add. For example, this command would add a new user named r2dee2:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nuseradd r2dee2\n<\/pre><\/div>\n\n\n<p>This command will create r2dee2&#8217;s home directory at <strong>\/home\/r2dee2\/<\/strong>. It will also assign the user to the default group for new users (usually <strong>Users<\/strong>). <\/p>\n\n\n\n<p>You can view all of the available options for this command by running man useradd.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/using-useradd-to-create-new-user.png\" alt=\"Using Useradd To Create New User\" class=\"wp-image-20988\" width=\"527\" height=\"60\"\/><figcaption>Using Useradd To Create New User<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Output-of-the-useradd-command-1024x732.png\" alt=\"Output Of The Useradd Command\" class=\"wp-image-20989\" width=\"672\" height=\"481\"\/><figcaption>The user is now added to our users list<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Add a New Group Using The useradd command<\/h2>\n\n\n\n<p>You can add groups just like you add users but, instead of the <strong>useradd command<\/strong>, we use groupadd. For example, to create a new group called managers, you would type:<\/p>\n\n\n\n<p>sudo groupadd managers<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.53.42-AM.png\" alt=\"Screenshot 2022 09 28 At 10.53.42 AM\" class=\"wp-image-21028\"\/><figcaption>Adding a new group<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Creating Users with a Custom Home Directory<\/h2>\n\n\n\n<p>By default, the useradd command will <strong>create the user&#8217;s home directory at \/home\/[username]<\/strong>. <\/p>\n\n\n\n<p>If you want to specify a different location for the user&#8217;s home directory, you can use the -d option. For example, this command will create a new user named John with his home directory at \/tmp\/tempuser:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nuseradd -d \/tmp\/tempuser temp_user_two\n<\/pre><\/div>\n\n\n<p>Keep in mind that you must create the destination directory before running this command. Otherwise, the command will fail.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Creating-a-temporary-user-1024x125.png\" alt=\"Creating A Temporary User\" class=\"wp-image-20986\" width=\"713\" height=\"86\"\/><figcaption>Creating A Temporary User<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Output-after-creating-the-temporary-user-1024x732.png\" alt=\"Output After Creating The Temporary User\" class=\"wp-image-20987\" width=\"747\" height=\"534\"\/><figcaption>Output After Creating The Temporary User<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a User with Specific User ID<\/h2>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo useradd -u 1001 username\n<\/pre><\/div>\n\n\n<p>The -u option allows you to specify the user ID (UID) for the new user. This can be useful if you have a set organizational structure and want to standardize how the UIDs are set for each user. Here we can replace 1001 with any permissible UID we like. The username can be changed as per the requirement as well.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/useradduid.png\" alt=\"Useradduid\" class=\"wp-image-21003\"\/><figcaption>Useradd with uid<\/figcaption><\/figure>\n\n\n\n<p>Now, let&#8217;s check the uid of the specific user, the username will be replaced with the username that exists in the system.<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nid -u username\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/uidcheck.png\" alt=\"Uidcheck\" class=\"wp-image-21004\"\/><figcaption>Uid check for the user<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Creating A Group With Specific Group ID<\/h2>\n\n\n\n<p>Just like every user has their own unique numeric identifier (UID), every group also has its own numeric identifier called GID or Primary Group Identifier.<\/p>\n\n\n\n<p>By default, when creating groups without explicitly assigning any particular GID, most Linux distributions assign them sequential GIDs starting from 1000.<\/p>\n\n\n\n<p>Let&#8217;s move on ahead and see how we can add additional groups for our newly created account along with specifying custom GIDs for each group!<\/p>\n\n\n\n<p>Every group also has a unique numeric identifier called a GID. By default, new groups are assigned the next available GID. However, you can use the -g option to specify a custom GID for a new group.<\/p>\n\n\n\n<p>For example, this command will create a new group named developers with GID 0935:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ngroupadd -g 0935 extinctspecies\n<\/pre><\/div>\n\n\n<p>This is useful if you are migrating users from another system and need to preserve their existing GIDs. It can also be helpful when setting up certain applications that require specific GIDs.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Adding-Group-Id-0935-Group-Name-extinctspecies-1024x161.png\" alt=\"Adding Group Id 0935 Group Name Extinctspecies\" class=\"wp-image-21006\" width=\"510\" height=\"80\"\/><figcaption>Adding Group Id 0935 Group Name extinctspecies<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Creating A User And Assign Multiple Groups<\/h2>\n\n\n\n<p>We&#8217;ve now learned how to add groups for our newly created account along with custom values. But what if we wanted to go one step further by actually assigning multiple groups to our users?<\/p>\n\n\n\n<p>Luckily! Linux provides us with the <strong>usermod command <\/strong>which makes managing groups a whole lot easier.<\/p>\n\n\n\n<p>You can assign multiple groups to a user by using the usermod command with the -a (append) option and -G (secondary group) option followed by a comma-separated list of desired groups. For example, this command will <strong>add the dinosaur user to both the sudo and extinctspecies groups<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nusermod -aG sudo,extinctspecies dinosaur\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-9.55.24-AM-1024x112.png\" alt=\"Screenshot 2022 09 28 At 9.55.24 AM\" class=\"wp-image-21010\" width=\"541\" height=\"59\"\/><figcaption>Adding the user dinosaur to two different groups sudo and extinctspecies<\/figcaption><\/figure>\n\n\n\n<p>We can check what all groups a user belong to by using:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ngroups &lt;username&gt;\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-9.58.12-AM.png\" alt=\"Screenshot 2022 09 28 At 9.58.12 AM\" class=\"wp-image-21011\" width=\"550\" height=\"79\"\/><figcaption>checking what groups the user dinosaur belong to<\/figcaption><\/figure>\n\n\n\n<p>If you want to remove a user from one or more groups, you can use the gpasswd command with the -d (delete) option followed by the username and group name. For example, this command would <strong>remove dinosaur from the sudo group<\/strong>:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\ngpasswd --delete dinosaur sudo\n<\/pre><\/div>\n\n\n<p>Adding\/removing users from additional groups might prove quite useful in multi-user environments where common tasks can be easily automated by making use of cron jobs hence every Linux power user can definitely benefit from knowing this particular technique.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.04.10-AM.png\" alt=\"Screenshot 2022 09 28 At 10.04.10 AM\" class=\"wp-image-21013\" width=\"557\" height=\"66\"\/><figcaption>Removing user dinosaur from sudo group<\/figcaption><\/figure>\n\n\n\n<p>Now that we have removed dinosaur from the sudo group let&#8217;s check what all group dinosaur is associated with,<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.05.22-AM.png\" alt=\"Screenshot 2022 09 28 At 10.05.22 AM\" class=\"wp-image-21014\" width=\"555\" height=\"57\"\/><figcaption>dinosaur groups after removal of sudo group<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a User with Specific Login Shell<\/h2>\n\n\n\n<p>Every user on a Linux system has their own personal login shell. This is the shell that is started when the user logs into the system. By default, new users are assigned the \/bin\/bash shell.<\/p>\n\n\n\n<p>However, you can use the -s option to specify a different login shell for the user. For example, this command would create a new user named trex with the \/bin\/zsh shell:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nuseradd -s \/bin\/zsh trex\n<\/pre><\/div>\n\n\n<p>Now let&#8217;s try implementing this,<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.10.02-AM-1024x72.png\" alt=\"Screenshot 2022 09 28 At 10.10.02 AM\" class=\"wp-image-21015\" width=\"584\" height=\"41\"\/><figcaption>Uh! Oh! Error adding user trex with zsh shell<\/figcaption><\/figure>\n\n\n\n<p>We need to check what all shells are installed in the system. You can view all of the available shells on your system by looking in the \/etc\/shells file.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.12.47-AM.png\" alt=\"Screenshot 2022 09 28 At 10.12.47 AM\" class=\"wp-image-21016\" width=\"472\" height=\"77\"\/><figcaption>Navigating to the etc\/shells file<\/figcaption><\/figure>\n\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.13.08-AM-1024x405.png\" alt=\"Screenshot 2022 09 28 At 10.13.08 AM\" class=\"wp-image-21017\" width=\"633\" height=\"250\"\/><figcaption>List of all the shell environments currently installed in the system<\/figcaption><\/figure>\n\n\n\n<p>Let&#8217;s go with \/bin\/bash for our user trex<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.21.17-AM.png\" alt=\"Screenshot 2022 09 28 At 10.21.17 AM\" class=\"wp-image-21018\" width=\"577\" height=\"28\"\/><figcaption>user trex added to the system with the \/bin\/bash shell environment<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Creating A User With Custom Comments<\/h2>\n\n\n\n<p>Up until now, we&#8217;ve pretty much focused on managing regular accounts. What if we wanted to add some sort of description or &#8220;comment&#8221; associated with each individual account?<\/p>\n\n\n\n<p>Luckily most popular Linux distributions including Ubuntu make it possible to do so using the following command:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nuseradd -c &#039;crocodile&#039; sarcosuchus\n<\/pre><\/div>\n\n\n<p>The -c option allows you to specify a comment for the user. This is useful if you want to add additional information about the user such as their full name or job title.<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.27.43-AM.png\" alt=\"Screenshot 2022 09 28 At 10.27.43 AM\" class=\"wp-image-21019\" width=\"662\" height=\"92\"\/><figcaption>Creating a new user sarcosuchus with the comment on the type of species which is &#8216;crocodile&#8217;<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a User with an Expiry Date in Linux<\/h2>\n\n\n\n<p>It is often desirable to create a user that has a limited lifespan. This might be the case when you want to give someone temporary access to your system. To do this, you can use the -e option with the useradd command. The format for this option is:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\n-e YYYY-MM-DD\n<\/pre><\/div>\n\n\n<p>For example, the following command would create a user called tempuser that would expire on May 31st, 2019:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo useradd -e 2022-09-29 velociraptor\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.35.02-AM.png\" alt=\"Screenshot 2022 09 28 At 10.35.02 AM\" class=\"wp-image-21021\" width=\"704\" height=\"79\"\/><figcaption>Adding a temp user velociraptor with an expiry date of 2022-09-29<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Creating a System User in Linux<\/h2>\n\n\n\n<p>System users are those that are used by system processes and services rather than by human beings. It is therefore important that they have very restricted permissions. To create a system user, you use the &#8211;system option with useradd like this:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo useradd --system dinosaur_moderator\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.37.45-AM.png\" alt=\"Screenshot 2022 09 28 At 10.37.45 AM\" class=\"wp-image-21022\" width=\"734\" height=\"88\"\/><figcaption>Adding a system user &#8216;dinosaur_moderator&#8217;<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Adding Password to User in Linux<\/h2>\n\n\n\n<p>If we want our new users to actually be able to log into our system, we need to give them passwords. We can do this using the passwd command like so: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo passwd newusername \n<\/pre><\/div>\n\n\n<p>Once again, you will be prompted for your password and then asked twice to enter a password for your new user. Be sure not to choose something too easy! <\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.46.47-AM.png\" alt=\"Screenshot 2022 09 28 At 10.46.47 AM\" class=\"wp-image-21025\" width=\"684\" height=\"163\"\/><figcaption>Adding password to the newly created user<\/figcaption><\/figure>\n\n\n\n<p>We have now added our first regular non-root user account but there\u2019s still one more thing we should do before logging out of our root account \u2013 add our new user account to the sudo group so that it can perform administrative tasks.<\/p>\n\n\n\n<p>We can do this with the usermod command like so: <\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo usermod -aG sudo dinosaur_moderator\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-large is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.48.54-AM-1024x107.png\" alt=\"Screenshot 2022 09 28 At 10.48.54 AM\" class=\"wp-image-21026\" width=\"842\" height=\"88\"\/><figcaption>adding administrative privileges to the newly added user<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Delete a User<\/h2>\n\n\n\n<p>Deleting a user account is just as easy as creating one. The command to use is userdel and, again, we need to be logged in as root or have superuser privileges. The basic syntax for deleting a user account is:<\/p>\n\n\n<div class=\"wp-block-syntaxhighlighter-code \"><pre class=\"brush: bash; title: ; notranslate\" title=\"\">\nsudo userdel &#x5B;username]\n<\/pre><\/div>\n\n\n<figure class=\"wp-block-image aligncenter size-full is-resized\"><img decoding=\"async\" src=\"https:\/\/www.linuxfordevices.com\/wp-content\/uploads\/2022\/09\/Screenshot-2022-09-28-at-10.51.26-AM.png\" alt=\"Screenshot 2022 09 28 At 10.51.26 AM\" class=\"wp-image-21027\" width=\"727\" height=\"119\"\/><figcaption>Deleting a user from the system<\/figcaption><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Summary<\/h2>\n\n\n\n<p>In this article, we have looked at how to add and delete user accounts on a Linux system as well as how to create groups. We have also seen how to change passwords and modify group memberships.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>There are multiple ways to create a user in Linux. The most common way is to use the useradd command. This command will add a new user to the system and create their home directory. In this article, let&#8217;s explore the useradd command in detail and understand the process of user creation in Linux. Also [&hellip;]<\/p>\n","protected":false},"author":73,"featured_media":12790,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_surecart_dashboard_logo_width":"180px","_surecart_dashboard_show_logo":true,"_surecart_dashboard_navigation_orders":true,"_surecart_dashboard_navigation_invoices":true,"_surecart_dashboard_navigation_subscriptions":true,"_surecart_dashboard_navigation_downloads":true,"_surecart_dashboard_navigation_billing":true,"_surecart_dashboard_navigation_account":true,"_uag_custom_page_level_css":"","footnotes":""},"categories":[19],"tags":[],"class_list":["post-12731","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"blocksy_meta":[],"uagb_featured_image_src":{"full":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2022\/09\/create-a-user-in-linux-1536x864.png.webp",1536,864,false],"thumbnail":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2022\/09\/create-a-user-in-linux-1536x864.png-150x150.webp",150,150,true],"medium":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2022\/09\/create-a-user-in-linux-1536x864.png-300x169.webp",300,169,true],"medium_large":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2022\/09\/create-a-user-in-linux-1536x864.png-768x432.webp",768,432,true],"large":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2022\/09\/create-a-user-in-linux-1536x864.png-1024x576.webp",1024,576,true],"1536x1536":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2022\/09\/create-a-user-in-linux-1536x864.png.webp",1536,864,false],"2048x2048":["https:\/\/codeforgeek.com\/wp-content\/uploads\/2022\/09\/create-a-user-in-linux-1536x864.png.webp",1536,864,false]},"uagb_author_info":{"display_name":"Ninad Pathak","author_link":"https:\/\/codeforgeek.com\/author\/ninad\/"},"uagb_comment_info":0,"uagb_excerpt":"There are multiple ways to create a user in Linux. The most common way is to use the useradd command. This command will add a new user to the system and create their home directory. In this article, let&#8217;s explore the useradd command in detail and understand the process of user creation in Linux. Also&hellip;","_links":{"self":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/posts\/12731","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/users\/73"}],"replies":[{"embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/comments?post=12731"}],"version-history":[{"count":0,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/posts\/12731\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/media\/12790"}],"wp:attachment":[{"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/media?parent=12731"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/categories?post=12731"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/codeforgeek.com\/wp-json\/wp\/v2\/tags?post=12731"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}