{"id":25042,"date":"2024-02-26T10:11:31","date_gmt":"2024-02-26T10:11:31","guid":{"rendered":"https:\/\/linuxways.net\/?p=25042"},"modified":"2024-02-26T10:11:31","modified_gmt":"2024-02-26T10:11:31","slug":"add-user-arch-linux","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/arch\/add-user-arch-linux\/","title":{"rendered":"How to Add a User in Arch Linux"},"content":{"rendered":"<p>Giving access of a single system to multiple users becomes easy by creating separate user accounts for each user. Moreover, by doing so the permissions of each user can be adjusted depending on their role, which makes it easy to monitor the tasks carried out by each user. On Arch Linux, multiple users can be added by creating their user accounts. Users can also be added in groups, as this makes it less difficult to assign permissions to all same-level users.<\/p>\n<p><strong>Outline: <\/strong><\/p>\n<ul>\n<li><a href=\"#post-25042-_amsa7kufq1lm\"><strong>How To Add a User in Arch Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-25042-_ihkctscs7sp6\"><strong>Through useradd Command<\/strong><\/a><\/li>\n<li><a href=\"#post-25042-_umxe9exc1uj0\"><strong>Through the system User Settings<\/strong><\/a><\/li>\n<li><a href=\"#post-25042-_z2gbe9godm98\"><strong>Adding a User to a Group<\/strong><\/a><\/li>\n<li><a href=\"#post-25042-_puea946a9s9a\"><strong>Modifying User Details in Arch Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-25042-_daa8deja8zgv\"><strong>How to Switch Users in Arch Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-25042-_jnx9c39cznsl\"><strong>How To Remove a User from Arch Linux<\/strong><\/a><\/li>\n<li><a href=\"#post-25042-_vj6w17d6xxab\"><strong>Conclusion<\/strong><\/a><\/li>\n<\/ul>\n<h2><a id=\"post-25042-_amsa7kufq1lm\"><\/a>How To Add a User in Arch Linux<\/h2>\n<p>In Arch Linux, the process of adding a user is simple, primarily there are two types of users, one with administrator privileges and the other without administrator privileges. Furthermore, there are different groups in every Linux distribution that deal with the permissions for accessing (reading, writing, and executing) any file or data of the system. On Arch Linux, there are two ways to add a user, which are:<\/p>\n<h3><a id=\"post-25042-_ihkctscs7sp6\"><\/a>Through useradd Command<\/h3>\n<p>To add a user in Arch Linux, whether you want an administrator user or a simple user with limited permissions, <em>useradd<\/em> command is normally used. However, the process for creating both the users is different:<\/p>\n<h3><a id=\"post-25042-_6y7jqbkqbfwj\"><\/a>1: Adding a User without administrator privileges<\/h3>\n<p>To create a simple user, just use the <em>useradd<\/em> command along with the m flag, which is responsible for creating a separate directory for the new user:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">useradd <span class=\"re5\">-m<\/span> username<\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"633\" height=\"132\" class=\"wp-image-25076\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-1.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-1.png 633w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-1-300x63.png 300w\" sizes=\"auto, (max-width: 633px) 100vw, 633px\" \/><\/strong><\/p>\n<p>Once the user is created, set the password for the user by using the <em>passwd<\/em> command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">passwd<\/span> <span class=\"sy0\">&lt;<\/span>User-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"631\" height=\"150\" class=\"wp-image-25078\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-2.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-2.png 631w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-2-300x71.png 300w\" sizes=\"auto, (max-width: 631px) 100vw, 631px\" \/><\/strong><\/p>\n<p>Alternatively, you can set the password while creating a user, and for that use the p flag for it:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> useradd <span class=\"re5\">-m<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span> <span class=\"re5\">-p<\/span> <span class=\"sy0\">&lt;<\/span>user-password<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p>Once the user is created, you can verify it by executing the <em>awk<\/em> command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">awk<\/span> <span class=\"re5\">-F<\/span><span class=\"st_h\">':'<\/span> <span class=\"st_h\">'{ print $1}'<\/span> <span class=\"sy0\">\/<\/span>etc<span class=\"sy0\">\/<\/span><span class=\"kw2\">passwd<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"743\" height=\"291\" class=\"wp-image-25079\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-3.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-3.png 743w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-3-300x117.png 300w\" sizes=\"auto, (max-width: 743px) 100vw, 743px\" \/><\/strong><\/p>\n<p>Further to confirm the permissions about the user simply login to it through the terminal and execute <em>whoami <\/em>command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">whoami<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"643\" height=\"141\" class=\"wp-image-25081\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-4.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-4.png 643w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-4-300x66.png 300w\" sizes=\"auto, (max-width: 643px) 100vw, 643px\" \/><\/strong><\/p>\n<h3><a id=\"post-25042-_memy02lehuu8\"><\/a>2: Adding a User with Administrator Privileges<\/h3>\n<p>Unlike the other Linux distributions, Arch Linux has a group called wheel which is considered as a sudo group, so to create a user with administrator rights use the G flag along with its name:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> useradd <span class=\"re5\">-m<\/span> <span class=\"re5\">-G<\/span> wheel <span class=\"sy0\">&lt;<\/span>User-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"672\" height=\"171\" class=\"wp-image-25082\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-5.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-5.png 672w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-5-300x76.png 300w\" sizes=\"auto, (max-width: 672px) 100vw, 672px\" \/><\/p>\n<p>In the sudoers file of Arch Linux you will find a group named sudo but adding a user to that group won\u2019t be possible as the sudo group is replaced by the wheel group. You can see the error of <em>group sudo doesn\u2019t exist<\/em> in the image below:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"686\" height=\"185\" class=\"wp-image-25083\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-6.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-6.png 686w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-6-300x81.png 300w\" sizes=\"auto, (max-width: 686px) 100vw, 686px\" \/><\/p>\n<p>Further, if at any instance you want to give administrator rights to a nonadministrator user, then use the <em>usermod<\/em> command along with the a and G flag. Here, the a flag is used to append a user to the supplementary group and is only valid with the G flag:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> usermod <span class=\"re5\">-a<\/span> <span class=\"re5\">-G<\/span> wheel <span class=\"sy0\">&lt;<\/span>use-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"675\" height=\"172\" class=\"wp-image-25085\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-7.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-7.png 675w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-7-300x76.png 300w\" sizes=\"auto, (max-width: 675px) 100vw, 675px\" \/><\/p>\n<p>Alternatively, you can add the user with administrator rights by giving it access to all the permissions to modify the system. For that, add the following line along with the username in the Arch sudoers file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"sy0\">%&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span> <span class=\"re2\">ALL<\/span>=<span class=\"br0\">&#40;<\/span>ALL:ALL<span class=\"br0\">&#41;<\/span> ALL<\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"669\" height=\"418\" class=\"wp-image-25087\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-8.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-8.png 669w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-8-300x187.png 300w\" sizes=\"auto, (max-width: 669px) 100vw, 669px\" \/><\/p>\n<p>Next, just create the user with the same name given in the sudoers file:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> useradd <span class=\"re5\">-m<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"681\" height=\"150\" class=\"wp-image-25088\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-9.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-9.png 681w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-9-300x66.png 300w\" sizes=\"auto, (max-width: 681px) 100vw, 681px\" \/><\/p>\n<p>Now set the password for the administrator user:<\/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> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"678\" height=\"160\" class=\"wp-image-25093\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-10.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-10.png 678w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-10-300x71.png 300w\" sizes=\"auto, (max-width: 678px) 100vw, 678px\" \/><\/p>\n<p>Upon verification of the created user you will see the root in the output which means this Arch user has admin rights:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">whoami<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"168\" class=\"wp-image-25097\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-11.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-11.png 644w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-11-300x78.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/p>\n<p>Further, you can verify the permission by listing the commands by using the l flag:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"re5\">-l<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"644\" height=\"153\" class=\"wp-image-25101\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-12.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-12.png 644w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-12-300x71.png 300w\" sizes=\"auto, (max-width: 644px) 100vw, 644px\" \/><\/p>\n<h3><a id=\"post-25042-_umxe9exc1uj0\"><\/a>Through System User Settings<\/h3>\n<p>Another method for adding a user in Arch Linux is by navigating it to the system user settings. Once you are in the user settings, unlock them first by password authentication:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"778\" height=\"542\" class=\"wp-image-25105\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-13.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-13.png 778w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-13-300x209.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-13-768x535.png 768w\" sizes=\"auto, (max-width: 778px) 100vw, 778px\" \/><\/p>\n<p>Next, click on the <strong>Add User<\/strong> option at the bottom and then add the details for the new user which include its name, username, and password. Here you will see the option for giving the user administrator rights, so to make an administrator user turn it on. You can also set the password on the user&#8217;s first login and once you are done with entering the details, just click <strong>Add<\/strong>:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"822\" height=\"668\" class=\"wp-image-25112\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-14.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-14.png 822w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-14-300x244.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-14-768x624.png 768w\" sizes=\"auto, (max-width: 822px) 100vw, 822px\" \/><\/p>\n<p>Now the new user will be listed below at the bottom:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"763\" height=\"502\" class=\"wp-image-25116\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-15.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-15.png 763w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-15-300x197.png 300w\" sizes=\"auto, (max-width: 763px) 100vw, 763px\" \/><\/p>\n<h3><a id=\"post-25042-_z2gbe9godm98\"><\/a>Adding a User to a Group<\/h3>\n<p>Adding users to a group on Arch is beneficial if each user has been assigned a specific role, and then assigning them each to a group can segregate the users. This will help in managing and organizing the user access to the system:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> groupmod <span class=\"re5\">-a<\/span> <span class=\"re5\">-U<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">&lt;<\/span>group-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"748\" height=\"185\" class=\"wp-image-25121\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-16.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-16.png 748w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-16-300x74.png 300w\" sizes=\"auto, (max-width: 748px) 100vw, 748px\" \/><\/strong><\/p>\n<h3><a id=\"post-25042-_puea946a9s9a\"><\/a>Modifying User Details in Arch Linux<\/h3>\n<p>Once you have added the user in Arch Linux, you can modify or change its details by executing <em>usermod<\/em> command. Like if you want to change the shell for any user, then in that case use the s flag along with the username and shell name:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> usermod <span class=\"re5\">-s<\/span> <span class=\"sy0\">&lt;<\/span>shell-name<span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"746\" height=\"175\" class=\"wp-image-25123\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-17.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-17.png 746w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-17-300x70.png 300w\" sizes=\"auto, (max-width: 746px) 100vw, 746px\" \/><\/p>\n<p>In all the Linux systems each user has its identification number that represents the user in the Linux kernel so on Arch Linux you change the user identification number for various reasons like reorganizing user accounts, migrating across different platforms or changing the permissions:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> usermod <span class=\"re5\">-u<\/span> <span class=\"sy0\">&lt;<\/span>new-UID<span class=\"sy0\">&gt;<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"744\" height=\"164\" class=\"wp-image-25126\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-18.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-18.png 744w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-18-300x66.png 300w\" sizes=\"auto, (max-width: 744px) 100vw, 744px\" \/><\/p>\n<p><strong>Note:<\/strong> There are some drawbacks for changing the UID like breaking the ownership and permissions, causing compatibility issues or creating security risks if not done properly.<\/p>\n<p>The next thing that you can modify is adding small information about the user which clarifies the role of the user. For that, use the c flag along with the<em> usermod<\/em> command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> usermod <span class=\"re5\">-c<\/span> <span class=\"st0\">&quot;&lt;info-to-be-added&gt;&quot;<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"746\" height=\"155\" class=\"wp-image-25129\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-19.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-19.png 746w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-19-300x62.png 300w\" sizes=\"auto, (max-width: 746px) 100vw, 746px\" \/><\/p>\n<h2><a id=\"post-25042-_daa8deja8zgv\"><\/a>How To Switch Users in Arch Linux<\/h2>\n<p>Once the user is created, you can switch to that new user if you want to install any applications or set up any file or folder. There are two ways to switch a user on Arch, one is by using the GUI and the other one is by using the terminal. Through GUI click on the power icon on the top right side and from the drop-down menu select <strong>Switch User<\/strong>:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"805\" height=\"526\" class=\"wp-image-25132\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-20.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-20.png 805w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-20-300x196.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-20-768x502.png 768w\" sizes=\"auto, (max-width: 805px) 100vw, 805px\" \/><\/strong><\/p>\n<p>Now login to the new user you created:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"759\" height=\"426\" class=\"wp-image-25135\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-21.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-21.png 759w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-21-300x168.png 300w\" sizes=\"auto, (max-width: 759px) 100vw, 759px\" \/><\/strong><\/p>\n<p>To switch to another user on Arch through the terminal is fairly simple, just execute the <em>su <\/em>command along with the username:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">su<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"746\" height=\"228\" class=\"wp-image-25137\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-22.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-22.png 746w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-22-300x92.png 300w\" sizes=\"auto, (max-width: 746px) 100vw, 746px\" \/><\/strong><\/p>\n<h2><a id=\"post-25042-_jnx9c39cznsl\"><\/a>How To Remove a User from Arch Linux<\/h2>\n<p>Just like creating a user has different ways, deleting or removing a user can be done in different ways. So if you haven\u2019t created a separate directory for the user, then execute the <em>userdel <\/em>command along with the username:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">userdel <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"630\" height=\"159\" class=\"wp-image-25141\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-23.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-23.png 630w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-23-300x76.png 300w\" sizes=\"auto, (max-width: 630px) 100vw, 630px\" \/><\/strong><\/p>\n<p>If you have created a separate directory and created a mail spool for that user, then use the r flag with the <em>userdel<\/em> command:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\">userdel <span class=\"re5\">-r<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"664\" height=\"149\" class=\"wp-image-25144\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-24.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-24.png 664w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-24-300x67.png 300w\" sizes=\"auto, (max-width: 664px) 100vw, 664px\" \/><\/strong><\/p>\n<p>If the user is already logged in then you will receive an error of <em>user is currently used by process<\/em> so in that case you need to kill the process related to that username:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> <span class=\"kw2\">killall<\/span> <span class=\"re5\">-u<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"665\" height=\"163\" class=\"wp-image-25145\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-25.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-25.png 665w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-25-300x74.png 300w\" sizes=\"auto, (max-width: 665px) 100vw, 665px\" \/><\/strong><\/p>\n<p>Once you have terminated all the processes then remove the user by using the f flag which will force the removal of the user account along with<em> the userdel <\/em>command on Arch and don&#8217;t forget to use sudo:<\/p>\n<div class=\"codecolorer-container bash blackboard\" style=\"width:100%;\"><div class=\"bash codecolorer\"><span class=\"kw2\">sudo<\/span> userdel <span class=\"re5\">-f<\/span> <span class=\"sy0\">&lt;<\/span>user-name<span class=\"sy0\">&gt;<\/span><\/div><\/div>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"666\" height=\"183\" class=\"wp-image-25148\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-26.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-26.png 666w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-26-300x82.png 300w\" sizes=\"auto, (max-width: 666px) 100vw, 666px\" \/><\/strong><\/p>\n<p>Alternatively, you can remove a user from Arch by system user settings first unlock the settings and then click on the user you want to remove, there select the <strong>Remove User<\/strong> option:<\/p>\n<p><strong><img loading=\"lazy\" decoding=\"async\" width=\"775\" height=\"598\" class=\"wp-image-25153\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-27.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-27.png 775w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-27-300x231.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2024\/02\/word-image-25042-27-768x593.png 768w\" sizes=\"auto, (max-width: 775px) 100vw, 775px\" \/><\/strong><\/p>\n<h2><a id=\"post-25042-_vj6w17d6xxab\"><\/a>Conclusion<\/h2>\n<p>Adding a user in Arch can be useful if you want to give restricted or administrator access to any other user. For adding the user on Arch there are two ways, one is by using the<em> useradd <\/em>command and the other is through Arch user settings. For giving administrator rights to a user, add it to wheel group in Arch by using the <em>usermod<\/em> command along with the G flag.<\/p>","protected":false},"excerpt":{"rendered":"<p>For adding the user on Arch there are two ways one is by using the useradd command and the other is through Arch user settings.<\/p>","protected":false},"author":113,"featured_media":25305,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1055],"tags":[],"class_list":["post-25042","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arch"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25042","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\/113"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=25042"}],"version-history":[{"count":0,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/25042\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/25305"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=25042"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=25042"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=25042"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}