{"id":7262,"date":"2019-01-07T07:23:48","date_gmt":"2019-01-07T07:23:48","guid":{"rendered":"https:\/\/www.appservgrid.com\/paw92\/?p=7262"},"modified":"2019-01-08T12:52:23","modified_gmt":"2019-01-08T12:52:23","slug":"centos-add-users-to-sudoers-linux-hint","status":"publish","type":"post","link":"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/07\/centos-add-users-to-sudoers-linux-hint\/","title":{"rendered":"CentOS Add Users to Sudoers \u2013 Linux Hint"},"content":{"rendered":"<p>In the case of any Linux system, there\u2019s a very powerful user \u2013 the \u201croot\u201d. It upholds the ULTIMATE power over the entire system, even modifying data at the hardware level! That\u2019s why it\u2019s so delicate and dangerous at the same time. Without the \u201croot\u201d access, hackers are forced to follow a trickier and more difficult path for taking over the system.The \u201croot\u201d privilege is responsible for performing all the actions that modifies the system files and packages. That\u2019s why in the enterprise\/professional workspace, not all users are allowed to run commands as they wish.<\/p>\n<p>CentOS also comes up with a similar policy. It only allows a certain users to perform actions with the \u201croot\u201d privilege. For example, whenever you run any command with the \u201csudo\u201d command, you\u2019ll get the following error \u2013<\/p>\n<p>For fixing the issue, the user account must be in the \u201csudoers\u201d file. In this tutorial, we\u2019ll check out on adding a user into the \u201csudoers\u201d file.<\/p>\n<p>The trick here is NOT directly editing the \u201c\/etc\/sudoers\u201d file. Instead, we\u2019ll be adding the specific user into the \u201cwheel\u201d group. In the case of CentOS, all the users in the group have the ability of running \u201csudo\u201d commands and that\u2019s the easier and safer way.<\/p>\n<p>This is also proven within the \u201c\/etc\/sudoers\u201d file \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/1-13.png\" alt=\"\" width=\"1020\" height=\"655\" \/><\/p>\n<h2>Optional \u2013 creating a new user<\/h2>\n<p>I\u2019m going to create a new user for the \u201csudo\u201d purpose only. Don\u2019t worry; you can easily add the existing user.<\/p>\n<p>Enter the \u201croot\u201d mode \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/2-13.png\" alt=\"\" width=\"884\" height=\"130\" \/><\/p>\n<p>Now, create a new user \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/3-13.png\" alt=\"\" width=\"884\" height=\"99\" \/><\/p>\n<p>Time to add a password for the newly created username \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/4-14.png\" alt=\"\" width=\"873\" height=\"159\" \/><\/p>\n<p>It\u2019s finally time to add the user \u201cYasuo\u201d on the \u201cwheel\u201d group. At first, make sure that you\u2019re logged as the \u201croot\u201d \u2013<\/p>\n<p>Now, perform the final action \u2013<\/p>\n<p>usermod -aG wheel &lt;username&gt;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/5-14.png\" alt=\"\" width=\"872\" height=\"140\" \/><\/p>\n<p>Everything is set!<\/p>\n<h3>Testing the outcome<\/h3>\n<p>Well, it\u2019s always worth testing the outcome, no matter how obvious it may seem. Let\u2019s try out running a \u201csudo\u201d command as \u201cYasuo\u201d \u2013<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/6-13.png\" alt=\"\" width=\"870\" height=\"114\" \/><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/linuxhint.com\/wp-content\/uploads\/2019\/01\/7-14.png\" alt=\"\" width=\"870\" height=\"396\" \/><\/p>\n<p>Voila! \u201cYasuo\u201d is now a privileged user account capable of \u201csudo\u201d!<\/p>\n<p><a href=\"https:\/\/linuxhint.com\/centos_add_users_sudoers\/\" target=\"_blank\" rel=\"noopener\">Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the case of any Linux system, there\u2019s a very powerful user \u2013 the \u201croot\u201d. It upholds the ULTIMATE power over the entire system, even modifying data at the hardware level! That\u2019s why it\u2019s so delicate and dangerous at the same time. Without the \u201croot\u201d access, hackers are forced to follow a trickier and more &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/www.appservgrid.com\/paw92\/index.php\/2019\/01\/07\/centos-add-users-to-sudoers-linux-hint\/\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;CentOS Add Users to Sudoers \u2013 Linux Hint&#8221;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7262","post","type-post","status-publish","format-standard","hentry","category-linux"],"_links":{"self":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7262","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/comments?post=7262"}],"version-history":[{"count":1,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7262\/revisions"}],"predecessor-version":[{"id":7599,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/posts\/7262\/revisions\/7599"}],"wp:attachment":[{"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/media?parent=7262"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/categories?post=7262"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appservgrid.com\/paw92\/index.php\/wp-json\/wp\/v2\/tags?post=7262"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}