{"id":253,"date":"2015-06-26T09:42:40","date_gmt":"2015-06-26T09:42:40","guid":{"rendered":"http:\/\/muse.oneshot.in\/?p=253"},"modified":"2015-06-26T09:42:40","modified_gmt":"2015-06-26T09:42:40","slug":"how-to-add-a-user-in-sudoers-file-redhat-or-how-to-configure-a-user-tohave-sudo-access","status":"publish","type":"post","link":"https:\/\/muse.oneshot.in\/?p=253","title":{"rendered":"How to add a user in sudoers file redhat Or How to configure a user tohave sudo access"},"content":{"rendered":"<p>How to add a user in sudoers file redhat Or How to configure a user tohave sudo access<\/p>\n<p>Sodo command offers administratoors a mechanism to provide users trusted users administrative rights withou the need to share the root password. Once a user is the part of sudo (Authenticated) they will get all the previlages of a root user.<\/p>\n<p>1) Add a new user<\/p>\n<p>useradd steve<\/p>\n<p># passwd steve<br \/>\nChanging password for user steve<br \/>\nNew password:<br \/>\nRetype new password:<br \/>\npasswd: all authentication tokens updated successfully.<\/p>\n<p>Edit the \/etc\/sudoers file using the command visudo<\/p>\n<p>#visudo<\/p>\n<p> Find the lines in the file that grant sudo access to users in the group wheel when enabled.<\/p>\n<p>## Allows people in group wheel to run all commands<br \/>\n# %wheel        ALL=(ALL)       ALL<\/p>\n<p>Remove the comment character (#) at the start of the second line. This enables the configuration option.<br \/>\nSave your changes and exit the editor.<br \/>\nAdd the user you created to the wheel group using the usermod command.<\/p>\n<p># usermod -aG wheel USERNAME<\/p>\n<p>Test that the updated configuration allows the user you created to run commands using sudo.<\/p>\n<p>    Use the su to switch to the new user account that you created.<\/p>\n<p>    # su steve &#8211;<\/p>\n<p>    Use the groups to verify that the user is in the wheel group.<\/p>\n<p>    $ groups<br \/>\n    steve wheel<\/p>\n<p>    Use the sudo command to run the whoami command. As this is the first time you have run a command using sudo from this user account the banner message will be displayed. You will be also be prompted to enter the password for the user account.<\/p>\n<p>    $ sudo whoami<br \/>\n    We trust you have received the usual lecture from the local System<br \/>\n    Administrator. It usually boils down to these three things:<\/p>\n<p>        #1) Respect the privacy of others.<br \/>\n        #2) Think before you type.<br \/>\n        #3) With great power comes great responsibility.<\/p>\n<p>    [sudo] password for steve:<br \/>\n    root<\/p>\n<p>    The last line of the output is the user name returned by the whoami command. If sudo is configured correctly this value will be root. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>How to add a user in sudoers file redhat Or How to configure a user tohave sudo access Sodo command offers administratoors a mechanism to provide users trusted users administrative rights withou the need to share the root password. Once a user is the part of sudo (Authenticated) they will get all the previlages of [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,6,8,4],"tags":[],"class_list":["post-253","post","type-post","status-publish","format-standard","hentry","category-information-technology","category-linux","category-linux-commands","category-redhat"],"_links":{"self":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts\/253","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=253"}],"version-history":[{"count":1,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts\/253\/revisions"}],"predecessor-version":[{"id":254,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=\/wp\/v2\/posts\/253\/revisions\/254"}],"wp:attachment":[{"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=253"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=253"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/muse.oneshot.in\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=253"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}