<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://www.slackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Sudo</id>
	<title>Sudo - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://www.slackwiki.com/index.php?action=history&amp;feed=atom&amp;title=Sudo"/>
	<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Sudo&amp;action=history"/>
	<updated>2026-04-08T16:10:06Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://www.slackwiki.com/index.php?title=Sudo&amp;diff=195&amp;oldid=prev</id>
		<title>Erik: Copy from old</title>
		<link rel="alternate" type="text/html" href="https://www.slackwiki.com/index.php?title=Sudo&amp;diff=195&amp;oldid=prev"/>
		<updated>2009-06-06T23:31:33Z</updated>

		<summary type="html">&lt;p&gt;Copy from old&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;Sudo is a program that lets a certain user run a program as root or another user. For instance say you want to let a user run &amp;lt;br&amp;gt;&lt;br /&gt;
/usr/sbin/alsactl with root privilege , but not give them your root password? In sudo you can do &lt;br /&gt;
this! First su into root and type:&lt;br /&gt;
 &lt;br /&gt;
 visudo&lt;br /&gt;
&lt;br /&gt;
You will now see a few example lines, Now first lets make the user &amp;quot;sandman1&amp;quot; be able to run alsactl as root:&lt;br /&gt;
 &lt;br /&gt;
 sandman1   ALL = /usr/sbin/alsactl&lt;br /&gt;
&lt;br /&gt;
Now of course you change the values of the following above. The first value &amp;quot;sandman1&amp;quot; is of course the username.&lt;br /&gt;
the ALL &amp;lt;br&amp;gt; is the hostname, now you can actually put the real host name there , or you can allow a user to be on any host by adding &amp;lt;br&amp;gt; ALL.  Now log into the user and type the following:&lt;br /&gt;
&lt;br /&gt;
 sudo /usr/sbin/alsactl&lt;br /&gt;
&lt;br /&gt;
This command will ask you for a password, type YOURS in and not root&lt;br /&gt;
and boom, you now can run /usr/sbin/alsactl as &amp;lt;br&amp;gt; root. With sudo you can&lt;br /&gt;
also run programs as a different username besides root:&lt;br /&gt;
&lt;br /&gt;
 sandman1   192.168.0.2 = (test) /usr/sbin/alsactl&lt;br /&gt;
&lt;br /&gt;
Now you noticed that I used an actual IP address in this&lt;br /&gt;
example. (That is my local IP anyways) Now you noticed the &amp;lt;br&amp;gt; (test) that&lt;br /&gt;
is the username that it will run as if i type the following command:&lt;br /&gt;
&lt;br /&gt;
 sudo -u test /usr/sbin/alsactl&lt;br /&gt;
&lt;br /&gt;
Now the following example makes it so you do not have to type any&lt;br /&gt;
password in:&lt;br /&gt;
&lt;br /&gt;
 %wheel   ALL = NOPASSWD: /usr/sbin/alsactl&lt;br /&gt;
&lt;br /&gt;
The % symbolizes that wheel is not a user, but a group. Now if you are&lt;br /&gt;
in the group wheel and type &amp;quot;sudo /usr/sbin/alsactl&amp;quot;, &amp;lt;br&amp;gt; you will notice&lt;br /&gt;
that it did not ask you for the password! Now all of this is great,&lt;br /&gt;
but what happens when you have more &amp;lt;br&amp;gt; than 1 user that is not in the&lt;br /&gt;
same group, but want to run the same command as root?&lt;br /&gt;
&lt;br /&gt;
 User_Alias GROUPOFUSERS = sandman1, sandy&lt;br /&gt;
 GROUPOFUSERS   ALL = NOPASSWD: /usr/sbin/alsactl&lt;br /&gt;
&lt;br /&gt;
Now the 2 users sandman1, and sandy can run /usr/sbin/alsactl as&lt;br /&gt;
root! Now see how easy it is to add multiple users? &amp;lt;br&amp;gt; You can also add&lt;br /&gt;
multiple Hosts as well:&lt;br /&gt;
&lt;br /&gt;
 Host_Alias SWEETHOST = 192.168.0.2, 192.168.0.3&lt;br /&gt;
 sandman1   SWEETHOST = NOPASSWD: /usr/sbin/alsactl&lt;br /&gt;
&lt;br /&gt;
Now you see how easy it is to setup multiple hosts? Now to find out&lt;br /&gt;
what commands you can run using sudo just type the &amp;lt;br&amp;gt; following command:&lt;br /&gt;
&lt;br /&gt;
 sudo -l&lt;br /&gt;
&lt;br /&gt;
That will list all the commands you are aloud to run! Now sudo is an&lt;br /&gt;
easy tool and I hope you have a great time using it.&lt;br /&gt;
&lt;br /&gt;
[[Category:Tutorials]]&lt;/div&gt;</summary>
		<author><name>Erik</name></author>
	</entry>
</feed>