{"id":63573,"date":"2022-09-26T15:56:01","date_gmt":"2022-09-26T22:56:01","guid":{"rendered":"https:\/\/linuxhint.com\/?p=63573"},"modified":"2022-09-28T21:01:12","modified_gmt":"2022-09-29T04:01:12","slug":"addinng_new_user_debian","status":"publish","type":"post","link":"https:\/\/linuxhint.com\/addinng_new_user_debian\/","title":{"rendered":"How to Add a New User on Debian 11"},"content":{"rendered":"<div id=\"wpbody\">\nAs a system administrator, if you install a new OS, you only have an access to a root account. The next and most important task after installing a new OS is adding new user accounts. All Linux OS including Debian supports the multiple users\u2019 accounts with each user having its own home directory, documents, and settings. The system Linux administrator can assign the different sets of permissions to each user account.<\/p>\n<p>In this article, we will discuss how you can add the new users on Debian 11. We will also discuss how to set the password for the new user and assign it with sudo privileges.<\/p>\n<p>As with Linux, we have different options to do a single task. Here, we will demonstrate three different ways: two command lines and one GUI method to add a new user account on Debian.<\/p>\n<ul>\n<li><a href=\"#b1\">Adding new user using useradd command<\/a><\/li>\n<li><a href=\"#b2\">Adding new user using adduser command<\/a><\/li>\n<li><a href=\"#b3\">Adding new user through system settings <\/a><\/li>\n<\/ul>\n<h2>Add New User on Debian 11 Through the Command Line Method<\/h2>\n<p>To add a new user on Debian 11 operating system through the command line, you need to open the Terminal utility. You can access the Terminal utility through the applications search bar. Click the \u201cActivities\u201d tab which is located at the top-left corner of the Debian 11 desktop and type <em>terminal<\/em> or <em>shell<\/em> in the search bar. Then, select the simple gnome-terminal application from the displaying search results as shown in the following:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-1.png\" alt=\"\" width=\"559\" height=\"180\" class=\"aligncenter size-full wp-image-229752\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-1.png 559w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-1-300x97.png 300w\" sizes=\"(max-width: 559px) 100vw, 559px\" \/><\/p>\n<h2 id=\"b1\">Using the \u201cuseradd\u201d Command <\/h2>\n<p>The useradd command in Linux is used to manage the user accounts. In this method, we will see how to use this command to create a new user in Debian.<\/p>\n<p>To add a new user in Linux, open the Terminal and run the useradd command as follows:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> useradd <span class=\"br0\">&#123;<\/span>username<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>For instance, to add a user named \u201ckarim\u201d, the command would be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> useradd karim<\/div><\/div>\n<p>This creates the new user \u201ckarim\u201d. After which, you can set a password for this account using the following command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">passwd<\/span> <span class=\"br0\">&#123;<\/span>username<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>For instance, to add and set the password for the user \u201ckarim\u201d, the command would be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">passwd<\/span> karim<\/div><\/div>\n<p>Then, set the password by typing and then retyping it to avoid any typos.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-2.png\" alt=\"\" width=\"470\" height=\"116\" class=\"aligncenter size-full wp-image-229753\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-2.png 470w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-2-300x74.png 300w\" sizes=\"(max-width: 470px) 100vw, 470px\" \/><\/p>\n<p>To create a new user with the home directory, use the useradd command with the -m option:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> useradd <span class=\"re5\">-m<\/span> <span class=\"br0\">&#123;<\/span>username<span class=\"br0\">&#125;<\/span> <span class=\"re5\">-s<\/span> <span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span><span class=\"kw2\">bash<\/span><\/div><\/div>\n<p>For instance, to create the user \u201ckarim\u201d with the home directory, the command would be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> useradd <span class=\"re5\">-m<\/span> karim <span class=\"re5\">-s<\/span> <span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span><span class=\"kw2\">bash<\/span><\/div><\/div>\n<p>This command creates the home directory \u201c\/home\/karim\u201d for the user \u201ckarim\u201d.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-3.png\" alt=\"\" width=\"581\" height=\"114\" class=\"aligncenter size-full wp-image-229754\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-3.png 581w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-3-300x59.png 300w\" sizes=\"(max-width: 581px) 100vw, 581px\" \/><\/p>\n<p>When you create a new user in Linux, the system automatically assigns a user ID (UID) to it. However, you can also create a new user with a specific user ID using the useradd command with the -u option:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> useradd <span class=\"re5\">-u<\/span> <span class=\"br0\">&#123;<\/span>user-id<span class=\"br0\">&#125;<\/span> <span class=\"br0\">&#123;<\/span>username<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>For instance, to create a new user &#8220;karim&#8221; with UID &#8220;1005&#8221;, the command would be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> useradd <span class=\"re5\">-u<\/span> <span class=\"nu0\">1005<\/span> karim<\/div><\/div>\n<h2 id=\"b2\">Using the \u201cadduser\u201d Command<\/h2>\n<p>In this method, we will use the adduser command to add a user on the Debian system.<\/p>\n<p>To add a new user in Linux, open the Terminal and run the adduser command as follows:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> adduser <span class=\"br0\">&#123;<\/span>username<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>For example, to create a new user named \u201ckarim\u201d, the command would be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> adduser karim<\/div><\/div>\n<p>After you run the previous command, it will ask you to provide your sudo password. Provide the password and press <strong>Enter<\/strong>. After this, the new user is created on your Debian system. Then, you will set the password for the new user by typing and then retyping it to avoid any typos.<\/p>\n<p>The message will appear on the Terminal saying that the \u201cpassword updated successfully\u201d. Now, you will be required to provide the information about the new user such as full name, phone number, etc. After you provide the information, you will be prompted to confirm. Press \u201cy\u201d and then press \u201cEnter\u201d to confirm that the provided info is correct.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-4.png\" alt=\"\" width=\"538\" height=\"343\" class=\"aligncenter size-full wp-image-229755\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-4.png 538w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-4-300x191.png 300w\" sizes=\"(max-width: 538px) 100vw, 538px\" \/><\/p>\n<h2>Verify the User Account Creation<\/h2>\n<p>To verify the user account creation, use either of the following commands:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">getent<\/span> <span class=\"kw2\">passwd<\/span> <span class=\"sy0\">|<\/span> <span class=\"kw2\">grep<\/span> <span class=\"br0\">&#123;<\/span>username<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>If the username exists, the command returns something like this:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-5.png\" alt=\"\" width=\"533\" height=\"48\" class=\"aligncenter size-full wp-image-229756\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-5.png 533w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-5-300x27.png 300w\" sizes=\"(max-width: 533px) 100vw, 533px\" \/><\/p>\n<p>Or<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">id<\/span> <span class=\"re5\">-u<\/span> <span class=\"br0\">&#123;<\/span>username<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>If the username exists, the command returns the user ID of the specified user.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-6.png\" alt=\"\" width=\"392\" height=\"47\" class=\"aligncenter size-full wp-image-229757\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-6.png 392w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-6-300x36.png 300w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-6-380x47.png 380w\" sizes=\"(max-width: 392px) 100vw, 392px\" \/><\/p>\n<p>To verify if the home directory is created, switch to the new user account using the \u201csu\u201d command. Then, run the following command to view the home directory of the current user:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw3\">echo<\/span> <span class=\"re1\">$HOME<\/span><\/div><\/div>\n<p>This returns the home directory for the current user.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-7.png\" alt=\"\" width=\"435\" height=\"112\" class=\"aligncenter size-full wp-image-229758\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-7.png 435w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-7-300x77.png 300w\" sizes=\"(max-width: 435px) 100vw, 435px\" \/><\/p>\n<p>You can also grant permission to newly created users using the command line. For instance, you create a Standard user and you want to grant it the sudo privileges. Then, using the following command, you can assign this user sudo privileges:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> usermod <span class=\"re5\">-aG<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"br0\">&#123;<\/span>username<span class=\"br0\">&#125;<\/span><\/div><\/div>\n<p>For instance, to assign the sudo privileges to new user \u201ckarim\u201d, the command would be:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"co4\">$ <\/span><span class=\"kw2\">sudo<\/span> usermod <span class=\"re5\">-aG<\/span> <span class=\"kw2\">sudo<\/span> karim<\/div><\/div>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-8.png\" alt=\"\" width=\"627\" height=\"86\" class=\"aligncenter size-full wp-image-229759\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-8.png 627w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-8-300x41.png 300w\" sizes=\"(max-width: 627px) 100vw, 627px\" \/><\/p>\n<p>Now, the new user can perform the administrative tasks as well.<\/p>\n<h2 id=\"b3\">Adding New User on Debian 11 Through GUI <\/h2>\n<p>To add a new user on Debian11 through graphical method, go to the system settings. Click on the drop-down arrow in the upper-right corner of your desktop. And then, click on the settings icon from the dropdown menu as follows: <\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-9.png\" alt=\"\" width=\"551\" height=\"415\" class=\"aligncenter size-full wp-image-229760\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-9.png 551w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-9-300x226.png 300w\" sizes=\"(max-width: 551px) 100vw, 551px\" \/><\/p>\n<p>Now, in the Settings utility, you type the keyword <em>users<\/em> in the search bar. When you see the user\u2019s icon in the search result, click it to open the User settings.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-10.png\" alt=\"\" width=\"606\" height=\"459\" class=\"aligncenter size-full wp-image-229761\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-10.png 606w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-10-300x227.png 300w\" sizes=\"(max-width: 606px) 100vw, 606px\" \/><\/p>\n<p>Click on the <strong>Unlock<\/strong> button in order to change the users&#8217; settings.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-11.png\" alt=\"\" width=\"465\" height=\"329\" class=\"aligncenter size-full wp-image-229762\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-11.png 465w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-11-300x212.png 300w\" sizes=\"(max-width: 465px) 100vw, 465px\" \/><\/p>\n<p>Provide the current user login password and click on \u201cAuthenticate\u201d as follows:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-12.png\" alt=\"\" width=\"564\" height=\"419\" class=\"aligncenter size-full wp-image-229763\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-12.png 564w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-12-300x223.png 300w\" sizes=\"(max-width: 564px) 100vw, 564px\" \/><\/p>\n<p>Now, the following window is displayed. Click on the \u201cAdd User\u201d button as follows:<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-13.png\" alt=\"\" width=\"610\" height=\"438\" class=\"aligncenter size-full wp-image-229764\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-13.png 610w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-13-300x215.png 300w\" sizes=\"(max-width: 610px) 100vw, 610px\" \/><\/p>\n<p>The following dialog appears for you to provide the information for the new user such as account type, Full Name, User name, and password if you want to set it now. Type the user information. Once done, click on the \u201cAdd\u201d button.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-14.png\" alt=\"\" width=\"618\" height=\"460\" class=\"aligncenter size-full wp-image-229765\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-14.png 618w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-14-300x223.png 300w\" sizes=\"(max-width: 618px) 100vw, 618px\" \/><\/p>\n<p>In the following window, you can see that the new user named \u201cKbuzdar\u201d is created successfully.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-15.png\" alt=\"\" width=\"663\" height=\"493\" class=\"aligncenter size-full wp-image-229766\" srcset=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-15.png 663w, https:\/\/linuxhint.com\/wp-content\/uploads\/2020\/07\/Add-a-New-User-on-Debian-11-15-300x223.png 300w\" sizes=\"(max-width: 663px) 100vw, 663px\" \/><\/p>\n<h2>Conclusion<\/h2>\n<p>While working on any Linux distribution, you should have the basic knowledge about the user management. In this article, you learned how to create a new user on Debian 11 using both ways: the command line method and the GUI. In addition, you also learned how to verify the user creation and assign the user administrator privileges. We hope that you like this article.\n<\/p><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Tutorial to create a new user on Debian 11 using the command line method and the GUI, verify the user creation and assign the user administrator privileges.<\/p>\n","protected":false},"author":72,"featured_media":229767,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1486],"tags":[],"class_list":["post-63573","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-debian"],"_links":{"self":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/posts\/63573","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/users\/72"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/comments?post=63573"}],"version-history":[{"count":0,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/posts\/63573\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/media\/229767"}],"wp:attachment":[{"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/media?parent=63573"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/categories?post=63573"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxhint.com\/wp-json\/wp\/v2\/tags?post=63573"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}