{"id":25313,"date":"2024-02-27T06:01:00","date_gmt":"2024-02-27T06:01:00","guid":{"rendered":"https:\/\/linuxways.net\/?p=25313"},"modified":"2024-02-27T06:01:00","modified_gmt":"2024-02-27T06:01:00","slug":"add-user-ubuntu-22-04","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/ubuntu\/add-user-ubuntu-22-04\/","title":{"rendered":"How to Add User on Ubuntu 22.04"},"content":{"rendered":"<p>In Linux, the administrator can create or add a user to the system to divide the task among other subordinate users. Administrators usually add regular users to the system to prevent them from accessing and messing up the base account. Adding multiple users on Ubuntu has many benefits, such as each user can customize the system according to their preferences and needs.<\/p>\n<p>Administrators can create both regular and system users. A regular user only has administrator privileges or has access to the sudo command once you provide it. While, on the other hand, the system user is the one who has all administrator privileges and can modify critical system files and configurations.<\/p>\n<p><strong>Outline<\/strong>:<\/p>\n<ul>\n<li><a href=\"#post-25313-_8vz7n5lzlpaq\">How to Add a User on Ubuntu 22.04<\/a><\/li>\n<li><a href=\"#post-25313-_op2abd8qg9mv\">How to Remove a User on Ubuntu 22.04<\/a><\/li>\n<li><a href=\"#post-25313-_seq3dod2zra5\">Conclusion<\/a><\/li>\n<\/ul>\n<h2><a id=\"post-25313-_8vz7n5lzlpaq\"><\/a>How to Add a User on Ubuntu 22.04<\/h2>\n<p>You can add user on Ubuntu 22.04 using:<\/p>\n<ul>\n<li><a href=\"#post-25313-_s1wwo02z05k8\">Terminal<\/a><\/li>\n<li><a href=\"#post-25313-_rt6vk3y6olat\">GUI<\/a><\/li>\n<\/ul>\n<h2><a id=\"post-25313-_s1wwo02z05k8\"><\/a>How to Add a User on Ubuntu 22.04 Through Terminal<\/h2>\n<p>The new user can be added on Ubuntu through the:<\/p>\n<ul>\n<li><a href=\"#post-25313-_mgb4h4d2g62a\">adduser Command<\/a><\/li>\n<li><a href=\"#post-25313-_k9ylekapc69j\">useradd Command<\/a><\/li>\n<li><a href=\"#post-25313-_jyky5h2n6c4d\">newusers Command<\/a><\/li>\n<\/ul>\n<h3><a id=\"post-25313-_mgb4h4d2g62a\"><\/a>Method 1: Add User on Ubuntu 22.04 Using the adduser Command<\/h3>\n<p>The <strong>adduser<\/strong> command creates a new user on the Linux system. It creates a home directory and configures the system for the new user side by side. Let&#8217;s check the instructions to add the user on Ubuntu 22.04.<\/p>\n<p><strong>Syntax:<\/strong><\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> adduser <span class=\"br0\">&#91;<\/span>Username<span class=\"br0\">&#93;<\/span><\/div><\/div>\n<p><strong>Note:<\/strong> Remember to replace the <strong>[username] <\/strong>with the your desired username. For system users, add the \u201c<strong>&#8211;system<\/strong>\u201d flag.<\/p>\n<h3><a id=\"post-25313-_26700w6le1n0\"><\/a>Add a Regular User on Ubuntu 22.04<\/h3>\n<p>Type the below command and execute it to add a user on Ubuntu 22.04:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> adduser johnny<\/div><\/div>\n<p>You will be asked to:<\/p>\n<ul>\n<li>Type the new user password and retype to confirm.<\/li>\n<li>Write your Full Name, Room Number, and Phone, or skip it by pressing the <strong>Enter <\/strong>button.<\/li>\n<li>Approve the information by entering <strong>Y<\/strong>.<\/li>\n<\/ul>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"747\" height=\"464\" class=\"wp-image-25319\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-1.png 747w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-1-300x186.png 300w\" sizes=\"auto, (max-width: 747px) 100vw, 747px\" \/><\/p>\n<p>Once the user is created, type the given command to verify whether the user was added successfully:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">id<\/span> johnny<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"752\" height=\"115\" class=\"wp-image-25321\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-2.png 752w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-2-300x46.png 300w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/p>\n<h3><a id=\"post-25313-_nwzsdmnr9gk7\"><\/a>Add a System User on Ubuntu 22.04<\/h3>\n<p>Specify the username with the \u201c<strong>&#8211;system<\/strong>\u201d flag to add the system user on Ubuntu:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> adduser <span class=\"re5\">--system<\/span> johnny1<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"808\" height=\"182\" class=\"wp-image-25324\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-3.png 808w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-3-300x68.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-3-768x173.png 768w\" sizes=\"auto, (max-width: 808px) 100vw, 808px\" \/><\/p>\n<p>Verify the user creation by executing the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">id<\/span> johnny1<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"805\" height=\"114\" class=\"wp-image-25327\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-4.png 805w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-4-300x42.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-4-768x109.png 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/p>\n<p><strong>Note: <\/strong>By default, the command used to add a system user doesn\u2019t allow you to set the password for a specific system user. You have to manually set the password for the system user by using the below-given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">passwd<\/span> johnny1<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"744\" height=\"159\" class=\"wp-image-25331\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-5.png 744w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-5-300x64.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/p>\n<p><strong>Note: <\/strong>If you created a system user, you may face an issue accessing the terminal from the system user account. If you encounter such an error, you can manually set it by first log in to the administrator account, and then running the following command to enable shell access for the system user:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">chsh<\/span> <span class=\"re5\">-s<\/span> <span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span><span class=\"kw2\">bash<\/span> johnny1<\/div><\/div>\n<p>Replace the <strong>username<\/strong> with your username:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"974\" height=\"103\" class=\"wp-image-25335\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-6.png 974w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-6-300x32.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-6-768x81.png 768w\" sizes=\"auto, (max-width: 974px) 100vw, 974px\" \/><\/p>\n<h3><a id=\"post-25313-_k9ylekapc69j\"><\/a>Method 2: Add User on Ubuntu 22.04 Using the Useradd Command<\/h3>\n<p>The <strong>useradd <\/strong>command can also be used to create a new user on Ubuntu 22.04. However, by default, the <strong>useradd <\/strong>command does not create a home directory and does not configure the newly created user configurations.<\/p>\n<p><strong>Syntax<\/strong><\/p>\n<p>Let\u2019s start by understanding the syntax:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> useradd <span class=\"sy0\">&lt;<\/span>options<span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">&lt;<\/span>username<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Where options include:<\/p>\n<ul>\n<li><strong>-b<\/strong>: base directory<\/li>\n<li><strong>-c<\/strong>: comment<\/li>\n<li><strong>-r<\/strong>: system<\/li>\n<li><strong>-p<\/strong>: password<\/li>\n<li><strong>-N<\/strong>: no user group<\/li>\n<li><strong>-s<\/strong>: shell<\/li>\n<li><strong>-u<\/strong>: user id<\/li>\n<li><strong>-h<\/strong>: help<\/li>\n<\/ul>\n<h3><a id=\"post-25313-_u0k9up7huw6m\"><\/a>Add Regular User on Ubuntu 22.04<\/h3>\n<p>Execute the<strong> useradd<\/strong> command with the username (without any options) to create a regular user:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> useradd james<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"723\" height=\"92\" class=\"wp-image-25341\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-7.png 723w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-7-300x38.png 300w\" sizes=\"auto, (max-width: 723px) 100vw, 723px\" \/><\/p>\n<p>Check whether the new user was created on Ubuntu by executing the id command followed by the username:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">id<\/span> james<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"114\" class=\"wp-image-25350\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-8.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-8-300x47.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<h3><a id=\"post-25313-_ukdvi9hnq1hn\"><\/a>Set or Change the User Password on Ubuntu 22.04<\/h3>\n<p>For a user on Ubuntu, you can set or change the password using the below command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">passwd<\/span> james<\/div><\/div>\n<p>After the command execution, type the new password and retype to confirm:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"796\" height=\"158\" class=\"wp-image-25358\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-9.png 796w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-9-300x60.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-9-768x152.png 768w\" sizes=\"auto, (max-width: 796px) 100vw, 796px\" \/><\/p>\n<h3><a id=\"post-25313-_lv4ixb9ezla\"><\/a>Add System User on Ubuntu 22.04<\/h3>\n<p>To add a system user using the <strong>useradd <\/strong>command, execute the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> useradd <span class=\"re5\">--system<\/span> kevin1<\/div><\/div>\n<p><strong>Note<\/strong>: You can also use the <strong>-r <\/strong>option instead of the <strong>&#8211;system<\/strong> flag to add a system user in Ubuntu:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"91\" class=\"wp-image-25362\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-10.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-10-300x38.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<p>Verify the username using:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">id<\/span> kevin1<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"726\" height=\"113\" class=\"wp-image-25370\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-11.png 726w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-11-300x47.png 300w\" sizes=\"auto, (max-width: 726px) 100vw, 726px\" \/><\/p>\n<h3><a id=\"post-25313-_qcbb0bbfn8so\"><\/a>Create and Add a User to the Group<\/h3>\n<p>The<strong> useradd<\/strong> command allows you to create and add a specific user to the group using a single command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> useradd <span class=\"re5\">-G<\/span> linuxways jimmy<\/div><\/div>\n<p>The <strong>-G <\/strong>denotes the group, and we have assigned the group to it by the name of linuxways, followed by the <strong>username <\/strong>to be created:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"725\" height=\"113\" class=\"wp-image-25376\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-12.png 725w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-12-300x47.png 300w\" sizes=\"auto, (max-width: 725px) 100vw, 725px\" \/><\/p>\n<p>Verify the user creation and addition to the group by executing the id command followed by the username:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">id<\/span> jimmy<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"724\" height=\"115\" class=\"wp-image-25385\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-13.png 724w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-13-300x48.png 300w\" sizes=\"auto, (max-width: 724px) 100vw, 724px\" \/><\/p>\n<p><strong>Note:<\/strong> When adding a system user, you can not set the password for the specific user. However, you can set the system user password manually by executing the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">passwd<\/span> jimmy<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"736\" height=\"159\" class=\"wp-image-25400\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-14.png 736w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-14-300x65.png 300w\" sizes=\"auto, (max-width: 736px) 100vw, 736px\" \/><\/p>\n<h3><a id=\"post-25313-_jyky5h2n6c4d\"><\/a>Method 3: Add User on Ubuntu 22.04 Using the newusers Command<\/h3>\n<p>The <a href=\"https:\/\/linuxways.net\/de\/ubuntu\/what-is-the-newusers-command-in-linux-ubuntu\/\"><strong>newusers<\/strong><\/a> command creates or updates the new users in bulk including regular and system users. The <strong>newusers<\/strong> command is mostly used in big IT companies where system administrators add a batch of users to the operating system. To add users in the batch using the newusers command, you have to create a text file first.<\/p>\n<p><strong>Syntax<\/strong><\/p>\n<p>Here is how to add the new user details in the text file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">User_name:Password:User_ID:Group_ID:User_Info:Home_Directory:Default_Shell<\/div><\/div>\n<p>Where,<\/p>\n<ul>\n<li><strong>User_name:<\/strong> type the username you want to create<\/li>\n<li><strong>Password:<\/strong> enter the username\u2019s password<\/li>\n<li><strong>User_ID:<\/strong> refers to the user ID to be created in the system<\/li>\n<li><strong>Group_ID:<\/strong> refer to the group ID in the system<\/li>\n<li><strong>User_Info:<\/strong> user information such as full name<\/li>\n<li><strong>Home_Directory:<\/strong> refers to the user\u2019s home directory<\/li>\n<li><strong>Default_Shell:<\/strong> refers to the default shell<\/li>\n<\/ul>\n<p>Check the stepwise guide below to add multiple regular users on the Ubuntu system through the <strong>newusers<\/strong> command.<\/p>\n<h3><a id=\"post-25313-_oojsqsg8re9s\"><\/a>Step 1: Create a File and Add the Users Data<\/h3>\n<p>To create a batch of regular users, first, we need to create a text file to add the users to it using the <strong>nano<\/strong> text editor in the Terminal. For that, run the given command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">nano<\/span> regular-user.txt<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"805\" height=\"95\" class=\"wp-image-25408\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-15.png 805w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-15-300x35.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-15-768x91.png 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/p>\n<p>Let&#8217;s add six users including their details in the text file. A new line must separate each user detail:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">linuxways1:pswd<span class=\"sy0\">@<\/span>123:<span class=\"nu0\">1001<\/span>:<span class=\"nu0\">1001<\/span>::<span class=\"sy0\">\/<\/span>home<span class=\"sy0\">\/<\/span>linuxways1:<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span><span class=\"kw2\">sh<\/span><br \/>\n<br \/>\nlinuxways2:pswd<span class=\"sy0\">@<\/span>123:<span class=\"nu0\">1002<\/span>:<span class=\"nu0\">1002<\/span>::<span class=\"sy0\">\/<\/span>home<span class=\"sy0\">\/<\/span>linuxways2:<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span><span class=\"kw2\">sh<\/span><br \/>\n<br \/>\nlinuxways3:pswd<span class=\"sy0\">@<\/span>123:<span class=\"nu0\">1003<\/span>:<span class=\"nu0\">1002<\/span>::<span class=\"sy0\">\/<\/span>home<span class=\"sy0\">\/<\/span>linuxways3:<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span><span class=\"kw2\">sh<\/span><br \/>\n<br \/>\nlinuxways4:pswd<span class=\"sy0\">@<\/span>123:<span class=\"nu0\">1004<\/span>:<span class=\"nu0\">1004<\/span>::<span class=\"sy0\">\/<\/span>home<span class=\"sy0\">\/<\/span>linuxways4:<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span><span class=\"kw2\">sh<\/span><br \/>\n<br \/>\nlinuxways5:pswd<span class=\"sy0\">@<\/span>123:<span class=\"nu0\">1005<\/span>:<span class=\"nu0\">1005<\/span>::<span class=\"sy0\">\/<\/span>home<span class=\"sy0\">\/<\/span>linuxways5:<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span><span class=\"kw2\">sh<\/span><br \/>\n<br \/>\nlinuxways6:pswd<span class=\"sy0\">@<\/span>123:<span class=\"nu0\">1006<\/span>:<span class=\"nu0\">1006<\/span>::<span class=\"sy0\">\/<\/span>home<span class=\"sy0\">\/<\/span>linuxways6:<span class=\"sy0\">\/<\/span>bin<span class=\"sy0\">\/<\/span><span class=\"kw2\">sh<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"442\" class=\"wp-image-25417\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-16.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-16-300x165.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-16-768x421.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<p>Save the data and exit the file.<\/p>\n<h3><a id=\"post-25313-_w17myklwfbmx\"><\/a>Step 2: Add Users to the Ubuntu System<\/h3>\n<p>Provide that \u201c<strong>.txt<\/strong>\u201d file to the <strong>newusers<\/strong> command (as an argument), as shown below:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> newusers regular-user.txt<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"807\" height=\"93\" class=\"wp-image-25421\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-17.png 807w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-17-300x35.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-17-768x89.png 768w\" sizes=\"auto, (max-width: 807px) 100vw, 807px\" \/><\/p>\n<h3><a id=\"post-25313-_hjjvoruoxoc9\"><\/a>Step 3: Verify the Batch User&#8217;s Creation<\/h3>\n<p>Check the user addition on Ubuntu by fetching the users from user ID 3 to 1000 by executing the below command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">awk<\/span> -F: <span class=\"st_h\">'$3 &gt;= 1000 {print}'<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span><span class=\"kw2\">passwd<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"248\" class=\"wp-image-25428\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-18.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-18-300x92.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-18-768x236.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<p><strong>Note:<\/strong> Adding multiple system users to the Ubuntu system is no different than adding the regular users except for adding the <strong>&#8211;system<\/strong> flag. The system user details are the same as the regular user except for adding a <strong>false<\/strong> value in the <strong>default shell<\/strong> environment and keeping the user ID range from 100-999.<\/p>\n<h2><a id=\"post-25313-_rt6vk3y6olat\"><\/a>How to Add User on Ubuntu 22.04 Using GUI (Graphical User Interface)<\/h2>\n<p>Just like CLI, a user can also be added to Ubuntu 22.04 using GUI settings. The steps to add a user on Ubuntu 22.04 using GUI are below.<\/p>\n<h3><a id=\"post-25313-_786kbfifu309\"><\/a>Step 1: Open System Settings<\/h3>\n<p>Hit the panel in the top-right corner and select <strong>Settings<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1013\" height=\"484\" class=\"wp-image-25444\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-19.png 1013w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-19-300x143.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-19-768x367.png 768w\" sizes=\"auto, (max-width: 1013px) 100vw, 1013px\" \/><\/p>\n<h3><a id=\"post-25313-_4o92fdxpg3c7\"><\/a>Step 2: Open Users Settings<\/h3>\n<p>Navigate to the <strong>Users<\/strong> tab, and click on the <strong>Unlock<\/strong> button to configure users:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"967\" height=\"489\" class=\"wp-image-25451\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-20.png 967w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-20-300x152.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-20-768x388.png 768w\" sizes=\"auto, (max-width: 967px) 100vw, 967px\" \/><\/p>\n<p>Enter the password to authenticate for user configuration:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"363\" class=\"wp-image-25457\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-21.png 412w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-21-300x264.png 300w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/p>\n<h3><a id=\"post-25313-_gm9mvbb456a9\"><\/a>Step 3: Add User on Ubuntu<\/h3>\n<p>Click on the <strong>Add User<\/strong> button to create a new user account:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"957\" height=\"341\" class=\"wp-image-25460\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-22.png 957w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-22-300x107.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-22-768x274.png 768w\" sizes=\"auto, (max-width: 957px) 100vw, 957px\" \/><\/p>\n<p>Provide the user details such as account type, name, or password, and click the <strong>Add <\/strong>button to create the user account:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"513\" height=\"547\" class=\"wp-image-25466\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-23.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-23.png 513w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-23-281x300.png 281w\" sizes=\"auto, (max-width: 513px) 100vw, 513px\" \/><\/p>\n<p><strong>Note:<\/strong> To create the Administrator user, select the <strong>Administrator<\/strong> option.<\/p>\n<p>Type the password and hit <strong>Authenticate<\/strong> to allow Ubuntu to add the user:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"363\" class=\"wp-image-25472\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-24.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-24.png 412w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-24-300x264.png 300w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/p>\n<h3><a id=\"post-25313-_4mikt8wjbic4\"><\/a>Step 4: Verify the User Addition<\/h3>\n<p>Open system <strong>Settings<\/strong>, navigate to the <strong>Users<\/strong> tab, and there you can see the newly added user on Ubuntu:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"971\" height=\"338\" class=\"wp-image-25475\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-25.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-25.png 971w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-25-300x104.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-25-768x267.png 768w\" sizes=\"auto, (max-width: 971px) 100vw, 971px\" \/><\/p>\n<h2><\/h2>\n<h2><a id=\"post-25313-_gimk2mi8e7rd\"><\/a>How to Add a User to a Sudo Group on Ubuntu 22.04<\/h2>\n<p>By default, every new user is created as the standard user in Ubuntu. To make it the administrator or sudo user, we need to execute a command manually.<\/p>\n<p><strong>Syntax<\/strong><\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> usermod <span class=\"re5\">-aG<\/span> <span class=\"kw2\">sudo<\/span> <span class=\"br0\">&#91;<\/span>Username<span class=\"br0\">&#93;<\/span><\/div><\/div>\n<p><strong>Remember<\/strong>: Replace the <strong>[Username]<\/strong> with your desired username.<\/p>\n<p>Execute this code in the Terminal to add the user to the sudo group:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> usermod <span class=\"re5\">-aG<\/span> <span class=\"kw2\">sudo<\/span> johnny<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"753\" height=\"92\" class=\"wp-image-25477\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-26.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-26.png 753w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-26-300x37.png 300w\" sizes=\"auto, (max-width: 753px) 100vw, 753px\" \/><\/p>\n<p>Execute the <strong>groups<\/strong> command along with the username to check the user addition in a sudo group:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">groups<\/span> johnny<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"806\" height=\"114\" class=\"wp-image-25478\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-27.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-27.png 806w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-27-300x42.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-27-768x109.png 768w\" sizes=\"auto, (max-width: 806px) 100vw, 806px\" \/><\/p>\n<h2><a id=\"post-25313-_op2abd8qg9mv\"><\/a>How to Remove a User on Ubuntu 22.04<\/h2>\n<p>The methods to remove a user on Ubuntu 22.04 are the same as for adding a user, such as using CLI and GUI.<\/p>\n<h3><a id=\"post-25313-_2phymqob9vpe\"><\/a>Method 1: Remove User on Ubuntu 22.04 Using Terminal<\/h3>\n<p>Open Terminal and execute the below command to delete the user from Ubuntu:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> deluser johnny<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"857\" height=\"182\" class=\"wp-image-25479\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-28.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-28.png 857w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-28-300x64.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-28-768x163.png 768w\" sizes=\"auto, (max-width: 857px) 100vw, 857px\" \/><\/p>\n<p><strong>Note:<\/strong> Replace <strong>johnny <\/strong>with the <strong>username<\/strong> you want to delete.<\/p>\n<p>Verify the user deletion by executing this command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">id<\/span> johnny<\/div><\/div>\n<p><strong>Note<\/strong>: Replace the johnny username with the username you want to delete:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"862\" height=\"114\" class=\"wp-image-25480\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-29.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-29.png 862w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-29-300x40.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-29-768x102.png 768w\" sizes=\"auto, (max-width: 862px) 100vw, 862px\" \/><\/p>\n<p>The output shows that the user no longer exists.<\/p>\n<h3><a id=\"post-25313-_gk6t898i3x1y\"><\/a>Method 2: Remove User on Ubuntu 22.04 Using GUI<\/h3>\n<p>To remove a user from Ubuntu, open <strong>Settings<\/strong>, move to the <strong>Users<\/strong> tab, unlock the users, and click the <strong>Remove User<\/strong> button:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"967\" height=\"635\" class=\"wp-image-25484\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-30.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-30.png 967w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-30-300x197.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-30-768x504.png 768w\" sizes=\"auto, (max-width: 967px) 100vw, 967px\" \/><\/p>\n<p>Select <strong>Delete Files<\/strong> to remove all files:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"653\" height=\"161\" class=\"wp-image-25486\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-31.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-31.png 653w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-31-300x74.png 300w\" sizes=\"auto, (max-width: 653px) 100vw, 653px\" \/><\/p>\n<p>Enter the user password and click the <strong>Authenticate<\/strong> button to remove the user from Ubuntu:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"412\" height=\"363\" class=\"wp-image-25487\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-32.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-32.png 412w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25313-32-300x264.png 300w\" sizes=\"auto, (max-width: 412px) 100vw, 412px\" \/><\/p>\n<h2><a id=\"post-25313-_seq3dod2zra5\"><\/a>Conclusion<\/h2>\n<p>Ubuntu lets you add users to the system, so you as a family can use a single machine individually with full privacy. Administrators can add a user on Ubuntu through Terminal and GUI. To add a user on Ubuntu using Terminal, users can use the <strong>useradd<\/strong>, <strong>newusers<\/strong>, and <strong>adduser commands<\/strong>. Moreover, to add a user using GUI, open <strong>Settings<\/strong> &gt; <strong>Users<\/strong>, authenticate the system to configure users, hit the <strong>Add User<\/strong> button, add user details, and click the <strong>Add<\/strong> button.<\/p>","protected":false},"excerpt":{"rendered":"<p>To add a user using GUI, open Settings > Users, authenticate the system to configure users, hit the Add User button, add user details, and click the Add button.<\/p>","protected":false},"author":110,"featured_media":25574,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2],"tags":[],"class_list":["post-25313","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ubuntu"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25313","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/users\/110"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=25313"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25313\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/25574"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=25313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=25313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=25313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}