Sudo Guide
From Linuxhelp Wiki
trocc4t fat nude women marketing communications jobs uk cell phone repair pamela smart sweet november movie trailer page kate winslow movie movie night invitations 6102 nokia ringtone christmas presents email spider gold 7.0 serial siemens a56i ringtone race cars for sale sneak preview movies movies lists church building http ringtone for rogers phone music video to stupid girls by pink top http jlo get right remix video mach and daddy music videos actonel and calcium mark martin viagra photo lyra video emy 18 video multi level network marketing red phosphorus mobil oil video movie theater carpet men masturbating in panties jlevi gorillaz 19-2000 boho clothing http girls of brazil adderall pictures airport miami shooting video jennifer love hewitt breasts mls for santa cruz county ladsim crack interactive sex games park seed lord of the rings sixties artists eucalyptus movies sexy naked chicks rocky mountain atv pleasanton realtor pharmacy schools in the united states of america possible worlds movie drug addict serial number corel draw erotic stories newsgroup eye of the cat movie ideas for nail art enfield ct movie theatres siskel movie 3310 keypress nokia ringtone golf course software top janet jackson video topless airline application continental job 6 mafia ringtone three arabic free nokia ringtone labia get longer aria giovanni movie gallery nunchaku training video discovery shuttle astronomy pictures nz drivers licence renewal hydrogen cars motorola v400 data cable and software couples resorts anticrash 3.6.1 crack ce2 velvet acid christ fun with drugs apex video player hairy chested men razr v3 video recording athena movies athens ohio isolde movie quote tristan whiplash injury 7 habits of highly effective people website creation software summary of how do i love thee ad blocker killer pop up south florida real estate listings rob thomas video incredables movie loadmovie in flash mx 2004 turnkey content management systems sony video camera battery sex caught on video nobody can stop me video bizzy bone dot transport boat wall decor mirror this old house uricosuric agents domain iceberg collide glacier arabic video clip movie pittman zoloft kc movies horny chicks lacerated wound julia malova movie pirate shirt uk horny comics comedian ron white shiavo video holistic health free mp3 phone ringtone kelly clarkson since u been gone video stills matweb free sony ericsson cell phone ringtones behavior management used pool table obese swimsuit models entertainment illusion movie portalofun.com showtimes nick harmon videos shane and shane streaming anime music videos sam movies rail stile router bits adderall smoking marmaris meadors court reporting coyote pictures pirated books online homepage 163 forties glamour movie photo portrait star hawaiian cruise embroidery software design swf machine legally blind benefit mighty morphin power rangers movie soundtrack quask serial kill bill 2 torrents networkview crack pirate name generators metoprolol drug interaction haleys comet hot russian single woman new york giants season ticket foot stools music video budget pictures of pretty girls volga river ong bok movie trailers alex african gray video bat fastpitch softball washington mutual bank on line product licence numbers for microsoft products asian bar girl martin luther king movie shakespeare life is a stage license plates of the world antlers oklahoma audio mp3 editor 1.01 serial bay area wedding caterer free jigsaw puzzle downloads prey michael crichton movie motion video software bomanite free full version games free movie sex trailer here adult friendfinders rum diarys movie panda 2005 serial calcomp drawing board iii web site design company mtka torrent something for joey movie free ebony porn sample video guide hunting wyoming spring bear hunts xylophone unique online business opportunity san diego real estate broker en gun rose video vivo laughter challenge video seperating audio and video from mpeg4 pipe lighters information on licensing parents nueva sangre torrent website rare video for sale mini stream ripper serial number page interactual video download illinois pharmacist licensure soup nazi i robot movie summary salt dallas convention center hotel movie theater in lancaster tx magnet calendars dog accessories heartagram logo iron maiden video clip keyword ppc se tenuate bosley snake respiratory system lighthouse family lifted minuit le soir torrent dakota fanning nude tom sawyer rush animated video backgrounds
didrex online buy ultracet sonyericsson ringtones mono ringtones buy valium diazepam online clomid online fioricet online paxil online free kyocera ringtones mp3 ringtones mp3 ringtones cheap alprazolam free alltel ringtones alprazolam online buy lipitor hydrocodone online verizon ringtones but levitra cheap tramadol buy hydrocodone free sprint ringtones xanax online free real ringtones tracfone ringtones buy propecia cheap ativan samsung ringtones cheap tramadol buy didrex but clomid lorazepam online free samsung ringtones cheap albuterol cheap zyban soma online clonazepam paxil online free real ringtones cheap sildenafil soma online ambien cheap wellbutrin cheap adipex buy propecia free real ringtones diethylpropion online free polyphonic ringtones rivotril online free jazz ringtones but lipitor lorazepam online prozac online carisoprodol online polyphonic ringtones online tenuate cheap valium polyphonic ringtones lipitor online free ringtones phentermine online sagem ringtones free free ringtones ultracet online ortho online buy vigrx online nexium meridia online free sharp ringtones free music ringtones cheap diazepam cheap carisoprodol but wellbutrin order meridia free ringtones xanax online free mtv ringtones fioricet online free mp3 ringtones nextel ringtones adipex online xanax online free sagem ringtones cheap diazepam clonazepam online polyphonic ringtones carisoprodol online buy wellbutrin free kyocera ringtones cheap ativan viagra online buy lorazepam ultram online kyocera ringtones cheap alprazolam free alltel ringtones cheap ambien vicodin online motorola ringtones free sony ericsson ringtones free punk ringtones viagra online cheap phentermine xanax online buy ultram cheap valium cingular ringtones adipex online cheap cyclobenzaprine propecia online cheap tenuate carisoprodol online cheap ultracet pharmacy online online free wwe ringtones diazepam online cheap xenical free nokia ringtones qwest ringtones cheap zanaflex cheap diazepam verizon ringtones motorola ringtones lortab online buy prozac ericsson ringtones ortho cyclobenzaprine online celexa online free ringtones phentermine free cool ringtones prozac online qwest ringtones cialis online sprint ringtones cheap nexium free real ringtones free sagem ringtones tracfone ringtones nokia ringtones free punk ringtones mp3 ringtones sony ringtones ativan online hgh midi ringtones free alltel ringtones flexeril online free sony ericsson ringtones free motorola ringtones vicodin online tracfone ringtones soma online order levitra free motorola ringtones didrex online cheap sildenafil cheap pharmacy online zoloft online order hydrocodone free sony ringtones cingular ringtones viagra online buy paxil buy ambien buy lortab cheap hydrocodone vigrx online ativan online buy hgh cheap sildenafil buy viagra buy ortho nextel ringtones online lisinopril free funny ringtones sony ericsson ringtones vicodin online but hydrocodone cheap ativan mono ringtones clonazepam online levitra sprint ringtones cialis online free sony ringtones cheap levitra cheap zanaflex but phentermine celexa online cheap ultracet free wwe ringtones free sharp ringtones buy norco soma online ultracet online free cingular ringtones cheap adipex xenical online| Author: | DJG |
| Created On: | January 1st, 2000 |
| Updated On: | Unknown |
Contents |
Introduction
sudo is a package which will allow privileged users to run commands as other users. This is sort of like assigning users to different groups to give them special permissions to files. However, this can allow users acccess to specific commands on specific machines, making it a more effective and more organized way of giving special priveleges to users.
First, you'll have to get the sudo package.
You can get the Debian package(.deb) at ftp://ftp.debian.org/ or by running 'apt-get install sudo'
You can get the RPM at http://www.rpmfind.net/RPM.
And if all else fails, you can always get the tarball http://www.courtesan.com/sudo/
Configuring SUDOers
Now that sudo has been installed, you should find a file called /etc/sudoers.
Before you start editing this file, you need to use a program called visudo, included in the sudo package. This edits provides security checks, parses for errors, and protects against multiple edits of the file.
Visudo takes the editor which is stored in the environment variable VISUAL so to pick an editor, for instance pico, while running a bash shell, enter the command:
export VISUAL="pico -w"
Now, simply type: visudo and it should open /etc/sudoers in that editor.
In /etc/sudoers, you should see something like this:
NOTE: You may see other things, this is what is in Debian's install. There are many options which I do not go over here, for instance how to override defaults. This guide is meant to be a source for creating a basic setup of sudo. You can find anything I did not include in "man sudoers" and "man sudo"
#Host alias specification #User alias specification #Cmnd alias specification #User privilege specification root ALL=(ALL) ALL
Here's a sample file, which is not real, but as I walk you through it, you should be able to understand how to setup this file.
Aliases are ways of referring to information by an (usually)easier name. They are sort of like the short hand way of writing something. In our case, aliases can point to 1 piece of information, or can point to groups of information as you'll see below.
Host alias specification
This section makes aliases for hosts. The syntax is:
Host_Alias ALIASFORHOSTNAMES = hostname1, hostname2, etc...
These will allow you to make an alias for sets of hostnames (Or even a single one.)
The two lines below make an alias called "DJNET," which refers to hostnames, djbox1 and djbox2 and an alias called "LINUXHELP," which will refer to hostnames lingroup1,lingroup2.
These hostnames should be referenced in /etc/hosts and you for the hostnames you may use IP addresses, hostnames in /etc/hosts, or other hostnames which may not be found in /etc/hosts.
Host_Alias DJNET = djbox1, djbox2 Host_Alias LINUXHELP = lingroup1,lingroup2
User alias specification
This section, like the Host Alias section basically is a way of grouping users.
The syntax is:
User_Alias USERGROUPNAMEALIAS = user1, user2, etc...
The below lines make 3 groups, ADMINS, PARTTIME, and LINUXGROUP, each containing different members.
User_Alias ADMINS = joe, bill, jake User_Alias PARTTIME = jim, jeff, mike User_Alias LINUXGROUP = lyte, SirPlaya
Cmnd alias specification
This section is a way of grouping commands together. The syntax is:
Cmnd_Alias COMMANDALIASNAME = command1,command2,etc...
If you'd like to specify arguments, you can use [] and wildcards to make commands. For instance, one of the below aliases, USERS includes has /usr/sbin/adduser [A-z]*, which means that they can run /usr/sbin/adduser and must have an argument of a 1 or more letters.
Cmnd_Alias BROWSE = /bin/ls, /bin/cd, /bin/cat Cmnd_Alias KILL = /bin/kill Cmnd_Alias USERS = /usr/sbin/adduser [A-z]*,/usr/sbin/userdel -r [A-z]*
User privilege specification
This is the User privilege section. This is where you give out the special priveleges to users, or user aliases using the aliases we have created above.
The syntax is:
USER HOST=COMMANDS Where USER can be either a user name or user alias, as well as HOST and COMMANDS.
The below line allows root access to everything... this shouldn't be a problem as root can do whatever he/she wants anyway.
root ALL=(ALL) ALL
This next line will allow the users specified in the ADMINS alias (joe, bill, and jake) and give them access to everything as well.
ADMINS ALL=ALL
This next line will show you another interesting feature of sudo. This allows the users in the PARTTIME alias (jim,jeff,mike) to do all of the commands listed in USERS,KILL,and BROWSE aliases on all servers. In addition to that, they may run /usr/bin/passwd followed by a 1 letter word or more(username of password to change) but the last option says that they CANNOT change root's password. ! is used to represent the word "NOT"
PARTTIME ALL=USERS,KILL,BROWSE,/usr/bin/passwd [A-z]*, !/usr/bin/passwd root
This next line allows user "djg" access to everything on the hosts listed in the alias DJNET(djbox1 and djbox2). It IS my network after all. :)
djg DJNET=ALL
Finally, this last line allows the users listed in the alias LINUXGROUP (lyte and SirPlaya) access to ALL commands as user "www" and to all of the commands listed in the aliases KILL,USERS, and BROWSE on the servers listed in the alias LINUXHELP(lingroup1 and lingroup2).
To specify that commands can be run as a user other than root, put the username in () in front of the commands. If you need to use root after that, you will have to specify it as seen below.
LINUXGROUP LINUXHELP=(www) ALL (root) KILL,USERS,BROWSE
Now that /etc/sudoers is configured properly, save it and exit visudo. If there are any errors, it should tell you.
Using Sudo
To list what you are allowed to do with sudo:
djg@localhost:~ $ sudo -l Password: (Enter your password here) User djg may run the following commands on this host:
(Here will be what you are allowed to do. It will follow the form of /etc/sudoers)
To use a privilege:
djg@localhost:~ sudo -u usertoruncommandas commandhere Password: (Enter your password here) (The command will then execute if everything is ok)
Flag -u will default to user root so if you're running a command as root, it's not necessary, simply use: sudo commandhere.
In some cases, it may not prompt you for a password. By default, sudo will allow you to go 5 minutes without entering a sudo command before it asks you for a password again. Again, as I said before, I don't go over how to change that in this guide. Everything you'll need is in the man pages. At some point, I may add that section to this guide.
Now you should have a fully working sudo package and now users can have special privileges.

