Log in to the system as the
Create a normal user account using the
useraddcommand. Replace USERNAME with the user name that you wish to create.
Set a password for the new user using the
passwdUSERNAME Changing password for user USERNAME. New password: Retype new password: passwd: all authentication tokens updated successfully.
visudoto edit the
/etc/sudoersfile. This file defines the policies applied by the
Find the lines in the file that grant
sudoaccess to users in the group
## Allows people in group wheel to run all commands # %wheel ALL=(ALL) ALL
Remove the comment character (#) at the start of the second line. This enables the configuration option.
Save your changes and exit the editor.
Add the user you created to the
wheelgroup using the
Test that the updated configuration allows the user you created to run commands using
suto switch to the new user account that you created.
groupsto verify that the user is in the
sudocommand to run the
whoamicommand. As this is the first time you have run a command using
sudofrom this user account the banner message will be displayed. You will be also be prompted to enter the password for the user account.
whoamiWe trust you have received the usual lecture from the local System Administrator. It usually boils down to these three things: #1) Respect the privacy of others. #2) Think before you type. #3) With great power comes great responsibility. [sudo] password for USERNAME: rootThe last line of the output is the user name returned by the
sudois configured correctly this value will be
You have successfully configured a user with
sudoaccess. You can now log in to this user account and use
sudoto run commands as if you were logged in to the account of the