Granting SUDO Access

Embed Size (px)

DESCRIPTION

sudo

Citation preview

allow a user to use the sudo command1. introduction2. edit the sudoers file3. test your work4. troubleshootintroductionAnaccountis a set of details that describes a user to anOS(Operating System). Details include a user name, a group that the user is a member of and a password that the user knows. The OS uses an account's user name and group to decide whether a user is authorized to perform an action. Thesudocommand allows a user to pretend she is someone else and execute a command.After allowing a user to use the sudo command you canchange accounts using sudo.edit the sudoers fileA special form of the vi editor calledvisudois used to edit the sudoers file. This lives in /opt/sudo/sbin.Don't edit a sudoers file except the one on ics01. A central sudoers file is kept on on this management station. This file is often copied out to all other hosts that the LIC support team looks after.1. Open a CLI on ics01.2. Use sudo to switch to the root account.3. Edit the file.root@ics01:>/opt/sudo/sbin/visudo################################################################################# File: /etc/sudoers..."/etc/sudoers.tmp" 129 lines, 5859 characters

4. Create a user alias list.User_Alias CUSTOMER01 = c1cejon, c1cejane, c1cefred

If you are adding a user to an existing group, this is all you have to do. Skip to the end.5. Create a command alias list.Cmnd_Alias SUC1IWS = /bin/su - c1apiws, /bin/su - c1foiws

6. Create the privilege line.CUSTOMER01 ALL=NOPASSWD:SUC1IWS

7. Save your work and close the file.:wq"/etc/sudoers.tmp" 129 lines, 5869 charactersroot@ics01:>

8. Close the CLI.test your work1. Open a CLI on ics01.2. Use sudo to switch to the user's account.3. Use sudo and a command in the Cmnd_alias list.c1cefred@ics01:>sudo su - c1apiwsUptime: 12:36pm up 95 day(s), 12:24, 33 users, load average: 0.20, 0.24, 0.28c1apiws@ics01:>exitc1cefred@ics01:>

4. Close the CLI.troubleshootAsked for a passwordYou may not have permission to do what you are trying to do. Press return to exit sudo.c1apiws@ics01:>sudo su -

We trust you have received the usual lecture from the local SystemAdministrator. It usually boils down to these two things:

#1) Respect the privacy of others. #2) Think before you type.

c1apiws@ics01's Password: