{"id":7758,"date":"2021-06-28T03:14:54","date_gmt":"2021-06-28T03:14:54","guid":{"rendered":"https:\/\/linuxways.net\/?p=7758"},"modified":"2021-06-28T03:14:54","modified_gmt":"2021-06-28T03:14:54","slug":"adding-users-to-sudo-group-on-linux-mint-20","status":"publish","type":"post","link":"https:\/\/linuxways.net\/de\/mint\/adding-users-to-sudo-group-on-linux-mint-20\/","title":{"rendered":"Adding Users to Sudo Group On Linux Mint 20"},"content":{"rendered":"<h2>Introduction<\/h2>\n<p>Normal users on Linux Mint can not execute commands that require root\/administrator privilege. With Sudo commands, unauthorized users can run commands that can only be run by root\/administrators. Sudo refers to &#8220;superuser do&#8221;. Sudo users or sudoers group is managed and defined through the sudoer file.<\/p>\n<p>In this article, you will learn various ways of adding and removing sudoers on Linux Mint 20.<\/p>\n<h2>Prerequisites<\/h2>\n<p>You will need a root\/sudo account to apply the following methods.<\/p>\n<h2>Assign Sudo Privileges by Adding Users to sudo Group<\/h2>\n<h3>Method 1:Add Users to sudo Group Using adduser command<\/h3>\n<p>Open the terminal and add the user to the sudo group with the following command.<\/p>\n<p>Note: Remember to change the username in command to the name of your user.<\/p>\n<pre>sudo adduser &lt;username&gt; sudo<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"250\" class=\"wp-image-7759\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-847.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-847.png 1000w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-847-300x75.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-847-768x192.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h3>Method 2: Add Users to sudo Group Using usermod command<\/h3>\n<p>Usermod command is used to manage, change, and modify existing users. You can add a user to sudo by executing the following usermod command on the terminal. Remember to change the username in command to the name of your user.<\/p>\n<pre>sudo usermod -a -G sudo &lt;user&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"155\" class=\"wp-image-7760\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-848.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-848.png 1000w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-848-300x47.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-848-768x119.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h3>Method 3: Add Users to sudo Group Using gpasswd command<\/h3>\n<p>The gpasswd command administers the \/etc\/group and \/etc\/gshadow directories. Enter the following gpasswd command to add users to the sudo group.<\/p>\n<pre>sudo gpasswd -a &lt;user&gt; sudo<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"130\" class=\"wp-image-7761\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-849.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-849.png 1000w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-849-300x39.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-849-768x100.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h2>Assign Sudo Privileges to User by Modifying the sudoers file<\/h2>\n<p>You can also give sudo privileges to users by directly editing the sudoers file located at \/etc\/sudoers.<\/p>\n<p>Note: This method authorizes a user to run sudo commands but does not add the user to the sudo group. Make note that managing privileges through a group is safe and standard practice.<\/p>\n<p>To make changes in the \/etc\/sudoers file, run the following command to open the sudoer file with the visudo tool.<\/p>\n<pre>sudo visudo<\/pre>\n<p>Add a new line\/rule at the end of the displayed file with the username you want to add.<\/p>\n<pre>&lt;username&gt; ALL=(ALL:ALL) ALL<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1708\" height=\"794\" class=\"wp-image-7762\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-850.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-850.png 1708w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-850-300x139.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-850-1024x476.png 1024w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-850-768x357.png 768w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-850-1536x714.png 1536w\" sizes=\"auto, (max-width: 1708px) 100vw, 1708px\" \/><\/p>\n<p>Click Ctrl+X to exit. Press y to update the file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"721\" height=\"174\" class=\"wp-image-7763\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-851.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-851.png 721w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-851-300x72.png 300w\" sizes=\"auto, (max-width: 721px) 100vw, 721px\" \/><\/p>\n<p>You will be again prompted to make changes in the file name. Do not edit and press \u2018Enter\u2019 to save the file.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"251\" class=\"wp-image-7764\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-852.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-852.png 1000w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-852-300x75.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-852-768x193.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<p>You can check if you have used the correct syntax while modifying the sudoer file by parsing it through the following command.<\/p>\n<pre>sudo visudo -c<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"231\" class=\"wp-image-7765\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-853.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-853.png 1000w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-853-300x69.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-853-768x177.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h2>Assign Sudo Privileges by Changing the User\u2019s Account Type to Administrator<\/h2>\n<p>To use this method head over to <strong>System Settings<\/strong> from the Applications.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"700\" height=\"729\" class=\"wp-image-7766\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-854.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-854.png 700w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-854-288x300.png 288w\" sizes=\"auto, (max-width: 700px) 100vw, 700px\" \/><\/p>\n<p>Now Go to the <strong>Administration<\/strong>&gt;<strong>User and Groups<\/strong>. Enter password when prompted for authentication.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"850\" height=\"666\" class=\"wp-image-7767\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-855.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-855.png 850w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-855-300x235.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-855-768x602.png 768w\" sizes=\"auto, (max-width: 850px) 100vw, 850px\" \/><\/p>\n<p>After successful authentication, you will see all users in the system. Select the user you want to assign sudo privilege and change its <strong>Account Type <\/strong>from <strong>Standard<\/strong> to <strong>Administrator<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"586\" class=\"wp-image-7768\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-856.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-856.png 750w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-856-300x234.png 300w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\n<h2>Check if the User has sudo Privileges<\/h2>\n<p>Verify if the user is added to the sudo group or not with the following command. This command will display all the groups that the user is a part of.<\/p>\n<pre>groups &lt;username&gt;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"230\" class=\"wp-image-7769\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-857.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-857.png 1000w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-857-300x69.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-857-768x177.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h2>Remove Users from sudo Group<\/h2>\n<h3>Method 1: Remove User from sudo Group Using deluser Command<\/h3>\n<p>You can remove the user from the sudo group by entering the following command with the username of the user that you want to remove.<\/p>\n<pre>sudo deluser &lt;username&gt; sudo<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"264\" class=\"wp-image-7770\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-858.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-858.png 1000w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-858-300x79.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-858-768x203.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h3>Method 2: Remove User from sudo Group Using passwd Command<\/h3>\n<p>Enter the passwd command with \u2018-d\u2019 option to remove the user from sudo.<\/p>\n<pre>sudo gpasswd -d &lt;username&gt; sudo<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"1000\" height=\"161\" class=\"wp-image-7771\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-859.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-859.png 1000w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-859-300x48.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-859-768x124.png 768w\" sizes=\"auto, (max-width: 1000px) 100vw, 1000px\" \/><\/p>\n<h2>Remove Sudo Privileges by Changing the User\u2019s Account Type to Standard<\/h2>\n<p>Go to the <strong>System Settings<\/strong>&gt;<strong>Administration<\/strong>&gt;<strong>User and Groups<\/strong>. Now change the user\u2019s <strong>Account Type <\/strong>from <strong>Administrator<\/strong> to<strong> Standard<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"639\" height=\"503\" class=\"wp-image-7772\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-860.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-860.png 639w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-860-300x236.png 300w\" sizes=\"auto, (max-width: 639px) 100vw, 639px\" \/><\/p>\n<p>You will see changes that sudo will be removed from the <strong>Groups<\/strong>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" width=\"750\" height=\"594\" class=\"wp-image-7773\" src=\"http:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-861.png\" srcset=\"https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-861.png 750w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-861-300x238.png 300w, https:\/\/linuxways.net\/wp-content\/uploads\/2021\/06\/word-image-861-150x120.png 150w\" sizes=\"auto, (max-width: 750px) 100vw, 750px\" \/><\/p>\n<h2>Conclusion:<\/h2>\n<p>In this article, we have learned how to add and remove users in the sudo group to manage the sudo privileges of the users.<\/p>","protected":false},"excerpt":{"rendered":"<p>Introduction Normal users on Linux Mint can not execute commands that require root\/administrator privilege. With Sudo commands, unauthorized users can run commands that can only be run by&hellip;<\/p>","protected":false},"author":1,"featured_media":7838,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[250,227],"class_list":["post-7758","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-mint","tag-sudo","tag-sudoers"],"_links":{"self":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7758","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\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/comments?post=7758"}],"version-history":[{"count":1,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7758\/revisions"}],"predecessor-version":[{"id":7837,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/posts\/7758\/revisions\/7837"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media\/7838"}],"wp:attachment":[{"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/media?parent=7758"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/categories?post=7758"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/linuxways.net\/de\/wp-json\/wp\/v2\/tags?post=7758"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}