{"id":465908,"date":"2022-06-20T19:00:47","date_gmt":"2022-06-20T16:00:47","guid":{"rendered":"https:\/\/en.buradabiliyorum.com\/how-to-add-users-on-linux\/"},"modified":"2022-06-20T19:00:47","modified_gmt":"2022-06-20T16:00:47","slug":"how-to-add-users-on-linux","status":"publish","type":"post","link":"https:\/\/buradabiliyorum.com\/en\/how-to-add-users-on-linux\/","title":{"rendered":"#How to Add Users on Linux"},"content":{"rendered":"<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_84 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6a26bbae62c47\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #dd3333;color:#dd3333\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #dd3333;color:#dd3333\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6a26bbae62c47\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-1'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-users-on-linux\/#%E2%80%9CHow_to_Add_Users_on_Linux%E2%80%9D\" >&#8220;How to Add Users on Linux&#8221;<\/a><ul class='ez-toc-list-level-2' ><li class='ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-users-on-linux\/#Computers_Need_Users\" >Computers Need Users<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-users-on-linux\/#The_useradd_Command\" >The useradd Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-users-on-linux\/#The_adduser_Command\" >The adduser Command<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-users-on-linux\/#The_GUI_Method\" >The GUI Method<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/buradabiliyorum.com\/en\/how-to-add-users-on-linux\/#Decisions_Decisions\" >Decisions Decisions<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h1><span class=\"ez-toc-section\" id=\"%E2%80%9CHow_to_Add_Users_on_Linux%E2%80%9D\"><\/span>&#8220;How to Add Users on Linux&#8221;<span class=\"ez-toc-section-end\"><\/span><\/h1>\n<div>\n<figure style=\"width: 1200px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" class=\"type:primaryImage size-full wp-image-791996\" data-pagespeed-no-defer=\"\" src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/03\/shutterstock_321627716.png?width=1198&amp;trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Linux laptop showing a bash prompt\" width=\"1200\" height=\"675\"\/><figcaption class=\"wp-caption-text\"><span class=\"type:primaryImage imagecredit\"><a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.shutterstock.com\/image-vector\/linux-interface-screen-notebook-world-map-321627716\">fatmawati achmad zaenuri\/Shutterstock.com<\/a><\/span><\/figcaption><\/figure>\n<p>Adding users to a Linux computer is a basic administration task, and there are several ways to achieve this. Each method has benefits and drawbacks. We explain three different techniques for you.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Computers_Need_Users\"><\/span>Computers Need Users<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>A personal computer without a user doesn\u2019t really amount to much. Linux supports <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.howtogeek.com\/803907\/linux-list-users\/\">multiple users. Whether they log in at the same time and share the computer\u2019s power, or sign in singly when they have exclusive use of the machine, each person needs a unique user account.<\/p>\n<p>A user account encapsulates that user\u2019s work and provides privacy. It also allows control and governance to be <a href=\"https:\/\/buradabiliyorum.com\/en\/category\/download-scripts-themes-apps\/\" data-internallinksmanager029f6b8e52c=\"9\" title=\"Download Scripts &amp; Themes &amp; Apps\" target=\"_blank\" rel=\"noopener\">app<\/a>lied to the account. Different users can have different capabilities according to their needs or their role or function by changing the attributes of their user account, like which groups they belong to.<\/p>\n<p>Whether you share your computer with family members or administer a multi-user installation for an organization, creating user accounts is a fundamental administrative skill.<\/p>\n<p>Linux being Linux, you have several methods to choose from. We\u2019re going to step you through three\u2014two command-line methods and one GUI-based method\u2014so that you can select the one you feel works best for you.<\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"The_useradd_Command\"><\/span>The useradd Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <code>useradd<\/code> command is the lowest-level command used for adding users. Other commands act as friendlier front-ends for the <code>useradd<\/code> command. This adds some convenience and makes the process easier, but the other commands don\u2019t do anything that you can\u2019t achieve with <code>useradd<\/code>\u00a0and a little help from the <code>passwd<\/code> command.<\/p>\n<p>The <code>useradd<\/code> command has a lot of options, the ones you\u2019ll need to add a typical new user are shown below. Needless to say, you\u2019ll have to use <code>sudo<\/code> to add a user.<\/p>\n<pre>sudo useradd -s \/bin\/bash -m -c \"Mary Quinn\" -Gsambashare maryq<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806111\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/1-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Adding a typical user with useradd\" width=\"644\" height=\"55\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The command is composed of:<\/p>\n<ul>\n<li><strong>sudo<\/strong>: We need administrator privileges to allow a new user to access the computer.<\/li>\n<li><strong>useradd<\/strong>: The <code>useradd<\/code> command.<\/li>\n<li><strong>-s \/bin\/bash<\/strong>: The shell option. This sets the default shell for this new user.<\/li>\n<li><strong>-m<\/strong>: The make home <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.howtogeek.com\/117435\/htg-explains-the-linux-directory-structure-explained\/\">directory option. This creates a directory in the \u201c\/home\/\u201d directory, with the same name as the new user account name.<\/li>\n<li><strong>-c \u201cMary Quinn\u201d<\/strong>: The full name of the new user. This is optional.<\/li>\n<li><strong>-Gsambashare<\/strong>: The additional group option. This is optional. The new user is added to a group with the same name as their account name. The <code>-G<\/code>\u00a0option (note, capital \u201cG\u201d) adds the user to supplementary groups. The groups must already exist. We\u2019re also making the new user a member of the \u201csambashare\u201d group.<\/li>\n<li><strong>maryq<\/strong>: The name of the new user account. This must be unique. It cannot already be in use for another user.<\/li>\n<\/ul>\n<p>This creates the new user account, creates their home directory, and populates it with some default hidden files. We can look into their home directory like this:<\/p>\n<pre>sudo ls -ahl \/home\/maryq<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806115\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/2-6.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The default configuration files added to the new user's home directory\" width=\"644\" height=\"190\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Our new user will not be able to log in. We haven\u2019t created a password for them. It is possible to pass the password to the <code>useradd<\/code> command using its <code>-p<\/code> (password) option, but this is considered bad practice. Moreover, you must provide the password in its\u00a0<em>encrypted<\/em>\u00a0form, so it isn\u2019t as straightforward as it sounds.<\/p>\n<p>It is easier, and more secure, to use the <code>passwd<\/code> command to set the password for the new account.<\/p>\n<pre>sudo passwd maryq<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806117\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/3-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Setting the password for the new account\" width=\"644\" height=\"130\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You\u2019re prompted for the password, then asked to enter it once more to verify it. This password must be communicated securely to the new user. It\u2019s advisable that they are prompted to change their password when they log in. This means they can choose their own password, and no one else will know it.<\/p>\n<pre>sudo passwd --expire maryq<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806118\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/4-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Setting the new user's password to the expired state\" width=\"644\" height=\"95\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>We can see our new user account and compare it to an existing one by looking inside the \u201c\/etc\/passwd\u201d file.<\/p>\n<pre>grep -E \"dave|maryq\" \/etc\/passwd<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806121\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/5-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Comparing the \/etc\/passwd entries of the new user account and an another account\" width=\"644\" height=\"110\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>In order, the colon \u201c:\u201d separated fields are:<\/p>\n<ul>\n<li><strong>maryq<\/strong>: The name of the user account.<\/li>\n<li><strong>x<\/strong>: An \u201cx\u201d in this field means the user account password is encrypted and held in the \u201c\/etc\/shadow\u201d file.<\/li>\n<li><strong>1001<\/strong>: The user account ID.<\/li>\n<li><strong>1001<\/strong>: The ID of the default group for this user account.<\/li>\n<li><strong>Mary Quinn<\/strong>: This is <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/en.wikipedia.org\/wiki\/Gecos_field\">the GECOS field<\/a>. It can hold a set of comma \u201c,\u201d separated values of extra information. All we added was the full name of the user.<\/li>\n<li><strong>\/home\/maryq<\/strong>: The path to the home directory for this account.<\/li>\n<li><strong>\/bin\/bash<\/strong>: The path to the default shell for this account.<\/li>\n<\/ul>\n<p>When our new user first logs in, they will use the password you created for them.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806123\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/6-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The new user logging in\" width=\"430\" height=\"250\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Because we set their password to the \u201cexpired\u201d condition, they\u2019ll be prompted to change it. They must re-enter their <em>existing<\/em> password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806125\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/7-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Re-entering the user's current password as the first part of changing their password\" width=\"430\" height=\"280\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>They are then prompted for their new password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806130\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/8-4.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Entering the new password\" width=\"430\" height=\"250\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Once they type their new password and hit \u201cEnter\u201d, they are asked to re-enter the password to verify it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806132\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/9-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Verifying the new password\" width=\"430\" height=\"250\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Finally, they\u2019re logged in. They must use the new password to log in from now on.<\/p>\n<p>Some housekeeping is performed and the usual \u201cDocuments\u201d, \u201cDownloads\u201d, and other directories are created for them in their home directory.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806135\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/10-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Default directories created inside the user's home directory\" width=\"644\" height=\"276\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>The GECOS field can contain up to five comma-separated pieces of information. These are rarely used. If any are populated at all, it is usually the first one, which holds the real-world name of the owner of this account.<\/p>\n<p>The fields are:<\/p>\n<ul>\n<li>The real-world name of this user.<\/li>\n<li>The room number of this user.<\/li>\n<li>Their work phone.<\/li>\n<li>Their home phone.<\/li>\n<li>Any other information.<\/li>\n<\/ul>\n<p>If we\u2019d wanted to provide all of this when we created the account we could have done so, like this:<\/p>\n<pre>sudo useradd -s \/bin\/bash -m -c \"Mary Quinn,Operations 1,555-6325,555-5412,Team Leader\" -Gsambashare maryq<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806137\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/11-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Adding a new user with a populated GECOS field, using useradd\" width=\"644\" height=\"75\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>We can use <code>grep<\/code> to see that this information has been stored in the \u201c\/etc\/passwd\u201d file.<\/p>\n<pre>grep maryq \/etc\/passwd<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806138\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/12-4.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Looking at the entry in \/etc\/passwd for the new user, with grep\" width=\"644\" height=\"110\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>If you don\u2019t have this information to hand when you create the account it can be added or changed later using the <code>chfn<\/code> command.<\/p>\n<p>This information is used by commands such as <code>finger<\/code> and <code>pinky<\/code>.<\/p>\n<pre>finger maryq<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806139\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/13-4.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Using the finger command on the new user\" width=\"644\" height=\"210\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"The_adduser_Command\"><\/span>The adduser Command<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <code>adduser<\/code> command wraps the creation of the account, its home directory, setting the password, and capturing the GECOS field information into one interactive session.<\/p>\n<p>The <code>adduser<\/code> command was already present on our Ubuntu and Fedora test machines but had to be installed on Manjaro. It\u2019s in the Arch User Repository, so you\u2019ll need to use an AUR helper such as <code>yay<\/code> to install it.<\/p>\n<pre>yay adduser<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806141\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/14-4.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Using yay on Manjaro to install adduser\" width=\"644\" height=\"55\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>To start the process, use <code>sudo<\/code> and provide the name of the user account you\u2019re adding:<\/p>\n<pre>sudo adduser maryq<\/pre>\n<p>The default group for the user account is created, and the user account is added with that group as its default. The home directory is created and the hidden configuration files are copied into it.<\/p>\n<p>You\u2019re prompted to provide a password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806142\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/15-4.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Using adduser to add a new user\" width=\"644\" height=\"170\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>When you provide a password and hit \u201cEnter\u201d, you\u2019re prompted to re-enter the password to verify it.<\/p>\n<p>You\u2019re asked in turn for each of the pieces of information that can go into the GECOS field.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806144\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/16-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Setting the password for the new account using adduser\" width=\"644\" height=\"270\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Either provide some information and hit \u201cEnter\u201d to move to the next field, or just hit \u201cEnter\u201d to skip a field.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806145\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/17-1.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The completed GECOS information in the adduser command\" width=\"644\" height=\"355\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Finally, you\u2019re asked if the information you have provided is correct. Press the \u201cY\u201d key, and hit \u201cEnter\u201d to complete the process.<\/p>\n<p>Remember to set the password for the new account as \u201cexpired\u201d so that the new user is required to change it when they first log in.<\/p>\n<pre>sudo password --expire maryq<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806118\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/4-5.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Setting the new user's password to the expired state\" width=\"644\" height=\"95\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"The_GUI_Method\"><\/span><a rel=\"nofollow noopener\" target=\"_blank\" name=\"autotoc_anchor_3\">The GUI Method<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Open the system menu by clicking on the right-hand edge of the GNOME panel, near the power, volume, and network icons.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806149\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/18-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The GNOME system menu\" width=\"335\" height=\"292\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Click on the \u201cSettings\u201d menu entry.<\/p>\n<p>The Settings application will open. Click on the \u201cUsers\u201d entry in the sidebar, then click on the \u201cUnlock\u201d button in the \u201cUsers\u201d pane.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806150\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/19-2.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The Users pane in the Settings application\" width=\"644\" height=\"322\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>You will need to enter your password.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806151\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/20.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Authenticating in the Settings application\" width=\"407\" height=\"356\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>A green \u201cAdd User\u201d button will appear.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806152\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/21.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The unlocked Users pane in the Settings application\" width=\"643\" height=\"312\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Click this button. The \u201cAdd user\u201d dialog appears. It contains a form that captures the details of the new user.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806153\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/22.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The Add User dialog\" width=\"507\" height=\"448\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>Fill in the form with the details of the new user. If you want them to be able to <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.howtogeek.com\/447906\/how-to-control-sudo-access-on-linux\/\">use <code>sudo<\/code>, click the \u201cAdministrator\u201d button.<\/p>\n<p>You can either set their password now or leave it to them to choose a password when they first log in.\u00a0If you set a password you\u2019ll have to remember to open a terminal window and use the <code>passwd <\/code> command to set it to the \u201cexpired\u201d state. That\u2019ll force them to set their own password the first time they log in.<\/p>\n<p>That\u2019s a bit of a pain to have to go to the terminal when you\u2019re trying to use the GUI to accomplish the creation of the new user.<\/p>\n<p>If you click the \u201cAllow user to set their own password when they next login\u201d radio button the user is prompted for a new password when they try to log in. But the drawback here is that the first person who tries to use the new account can set the password. So anyone who knows the account has been created and who beats the genuine new user to trying to log in can take over the account.<\/p>\n<p>Neither of these situations is ideal.<\/p>\n<p>Click the green \u201cAdd\u201d button when you\u2019ve completed the form and made your selections.<\/p>\n<p>We selected the\u00a0\u201cAllow user to set their own password when they next login\u201d option. When the user tries to log in they\u2019re prompted for a new password. But, unlike the sequence we saw earlier, they are not prompted for their current password\u2014they don\u2019t have one.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806158\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/23.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"The new user being forced to choose a new password\" width=\"429\" height=\"315\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<p>As you\u2019d expect, they have to enter it once more to verify it.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-806162\" data-pagespeed-lazy-src=\"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/05\/24.png?trim=1,1&amp;bg-color=000&amp;pad=1,1\" alt=\"Verifying the new password\" width=\"430\" height=\"250\" src=\"\/pagespeed_static\/1.JiBnMqyl6S.gif\" onload=\"pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\" onerror=\"this.onerror=null;pagespeed.lazyLoadImages.loadIfVisibleAndMaybeBeacon(this);\"\/><\/p>\n<h2 role=\"heading\" aria-level=\"2\"><span class=\"ez-toc-section\" id=\"Decisions_Decisions\"><\/span>Decisions Decisions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>The <code>useradd<\/code> command gives granular control, but there\u2019s a lot to get right on the command line.<\/p>\n<p>The <code>adduser<\/code> command makes life easier but doesn\u2019t allow you to enter the new user into additional groups.<\/p>\n<p>The GUI method has drawbacks whichever password radio button you choose.<\/p>\n<p>In most informal or domestic situations, <code>adduser<\/code> command probably gives you the best balance between capability and functionality. If you need to add the new user to an additional group, you can do that once they\u2019ve been created, <a rel=\"nofollow noopener\" target=\"_blank\" href=\"https:\/\/www.howtogeek.com\/50787\/add-a-user-to-a-group-or-second-group-on-linux\/\">using the <code>usermod<\/code> command.<\/p>\n<p><strong>RELATED:<\/strong> <strong><em>Add a User to a Group (or Second Group) on Linux<\/em><\/strong><\/p>\n<\/div>\n<p><script>\n setTimeout(function(){\n  !function(f,b,e,v,n,t,s)\n  {if(f.fbq)return;n=f.fbq=function(){n.callMethod?\n  n.callMethod.apply(n,arguments):n.queue.push(arguments)};\n  if(!f._fbq)f._fbq=n;n.push=n;n.loaded=!0;n.version='2.0';\n  n.queue=[];t=b.createElement(e);t.async=!0;\n  t.src=v;s=b.getElementsByTagName(e)[0];\n  s.parentNode.insertBefore(t,s) } (window, document,'script',\n  'https:\/\/connect.facebook.net\/en_US\/fbevents.js');\n   fbq('init', '335401813750447');\n   fbq('track', 'PageView');\n  },3000);\n<\/script><\/p>\n<blockquote><p><strong><span style=\"color: #ff6600;\">If you liked the article, do not forget to share it with your friends. Follow us on\u00a0<span style=\"color: #ff0000;\"><a style=\"color: #ff0000;\" href=\"https:\/\/news.google.com\/publications\/CAAqBwgKMLG0nwswvr63Aw\" target=\"_blank\" rel=\"nofollow noopener noreferrer\">Google News<\/a><\/span>\u00a0too, click on the star and choose us from your favorites.<\/span><\/strong><\/p><\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\">For forums sites go to <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/forum.buradabiliyorum.com\/\" target=\"_blank\" rel=\"noopener\">Forum.BuradaBiliyorum.Com<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<blockquote>\n<p style=\"text-align: center;\"><strong>If you want to read more like this article, you can visit our <span style=\"color: #ff9900;\"><a style=\"color: #ff9900;\" href=\"https:\/\/en.buradabiliyorum.com\/technology\/\" target=\"_blank\" rel=\"noopener\">Technology category.<\/a><\/span><\/strong><\/p>\n<\/blockquote>\n<p><span style=\"color: black;\"><a style=\"color: #ff9900;\" href=\"https:\/\/www.howtogeek.com\/806104\/add-a-user-to-linux\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;How to Add Users on Linux&#8221; fatmawati achmad zaenuri\/Shutterstock.com Adding users to a Linux computer is a basic administration task, and there are several ways to achieve this. Each method has benefits and drawbacks. We explain three different techniques for you. Computers Need Users A personal computer without a user doesn\u2019t really amount to much&#8230;.<\/p>\n","protected":false},"author":1,"featured_media":465909,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"fifu_image_url":"https:\/\/www.howtogeek.com\/wp-content\/uploads\/2022\/03\/shutterstock_321627716.png?height=200p&trim=2,2,2,2","fifu_image_alt":"","footnotes":""},"categories":[18],"tags":[],"class_list":["post-465908","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-technology"],"_links":{"self":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/465908","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/comments?post=465908"}],"version-history":[{"count":0,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/posts\/465908\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media\/465909"}],"wp:attachment":[{"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/media?parent=465908"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/categories?post=465908"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/buradabiliyorum.com\/en\/wp-json\/wp\/v2\/tags?post=465908"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}