<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>gHacks technology news &#187; /etc/sudoers</title>
	<atom:link href="http://www.ghacks.net/tag/etcsudoers/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.ghacks.net</link>
	<description>A technology blog covering software, mobile phones, gadgets, security, the Internet and other relevant areas.</description>
	<lastBuildDate>Tue, 24 Nov 2009 11:26:04 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.6</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Give users specific access with sudo</title>
		<link>http://www.ghacks.net/2009/06/24/give-users-specific-access-with-sudo/</link>
		<comments>http://www.ghacks.net/2009/06/24/give-users-specific-access-with-sudo/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 20:44:20 +0000</pubDate>
		<dc:creator>Jack Wallen</dc:creator>
				<category><![CDATA[Advice]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[Open Source]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[Tutorials Basic]]></category>
		<category><![CDATA[/etc/sudoers]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://www.ghacks.net/?p=13835</guid>
		<description><![CDATA[If you&#8217;re new to Linux chances are you know about Ubuntu. Ubuntu has done a great job making a distribution of Linux new-user friendly. One of the ways they have done this is by making the root user (the super user) somewhat transparent. The user can not log in as the root user in a [...]]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re new to Linux chances are you know about Ubuntu. Ubuntu has done a great job making a distribution of Linux new-user friendly. One of the ways they have done this is by making the root user (the super user) somewhat transparent. The user can not log in as the root user in a Ubuntu system (unless they have made it so) and the user has to use the <em>sudo </em>utility in order to run administrative tasks.</p>
<p>Now as an administrator of a Linux system, the <em>sudo</em> utility is a great way to manage user permissions with regards to access (especially with regard to applications). Say, for example, you have a specific executable file placed in <strong>/usr/sbin</strong> that you want your standard users to be able to use along with the ability to use the tools in the whole <strong>/usr/bin. </strong>Or say you have one specific user on your system that you want to give full administrative access to. This can all be done with the help of sudo. Let&#8217;s see how.</p>
<p><span id="more-13835"></span><strong>A quick intro</strong></p>
<p>If you&#8217;re not familiar with sudo, let me give you a quick synopsis. The <em>sudo </em>tool allows you to effectively execute a command as a user with the security pirvileges of another user. Most often, as in Ubuntu, this allows a standard user to issue commands with administrative privileges. The basic command is issued like this:</p>
<p>sudo COMMAND</p>
<p>Where COMMAND is the command you want to run. You will then be prompted for your user password. Of course you don&#8217;t need to use <em>sudo</em> if you are running standard commands that do not require administrative privileges.</p>
<p><strong>Sudo configuration</strong></p>
<p>Sudo is configured with the help of a single file: <strong>/etc/sudoers</strong>. When you look at this file you will most likely be a bit tentative to make any changes. Fortunately the changes we are going to make are fairly basic. You do have to use <em>sudo </em>to make changes to the <strong>sudoers</strong> file. So to open this file with the <em>nano</em> editor you would issue the command:</p>
<p><em>sudo nano /etc/sudoers</em></p>
<p>and then give your user password.</p>
<p><strong>Add a user for all administrative privileges</strong></p>
<p>To add an already existing user to this file you would add a line in the main section. This &#8220;main&#8221; section can be found by searching for the root entry which looks like:</p>
<p><em>root</em> <em>ALL=(ALL)     ALL</em></p>
<p>Not only is that the line you are looking for, it is also the structure of the line you will add. Let&#8217;s say you want to add the user <em>onichan</em> to give her administrative rights with sudo. To do this the line would look like:</p>
<p><em>onichan     ALL=(ALL)     ALL</em></p>
<p>Now, there is one problem with adding a user like this. What a user can do is, effectively, gain access to the real, permanent root user and avoid all logging handle by sudo. So instead of the above, let&#8217;s give <em>onichan</em> permission to execute commands in specific directories. We&#8217;ll give her pemission to run commands in the following:</p>
<ul>
<li><strong>/usr/sbin/</strong></li>
<li><strong>/sbin</strong></li>
</ul>
<p>This entry will look like:</p>
<p><em>onichan ALL=/usr/sbin, /sbin</em></p>
<p>Now user <em>onichan</em> can execute commands in both <strong>/usr/sbin</strong> and <strong>/sbin</strong> using <em>sudo </em>and giving her user password.</p>
<p><strong>Final thoughts</strong></p>
<p>This only skims the surface of the power of sudo. We&#8217;ll cover many more aspects of this outstanding administrative tool in later articles. But at least now you can see how <em>sudo</em> works and how to add users. There are other aspects of <em>sudo</em> that I do not recommend employing (such as the NOPASSWD feature), but every system has unique needs.</p>
<p><strong><br />
</strong></p>
<p><em><br />
</em></p>

	Tags: <a href="http://www.ghacks.net/tag/etcsudoers/" title="/etc/sudoers" rel="tag">/etc/sudoers</a>, <a href="http://www.ghacks.net/tag/linux/" title="Linux" rel="tag">Linux</a>, <a href="http://www.ghacks.net/tag/sudo/" title="sudo" rel="tag">sudo</a><br />

	<h4>Related posts</h4>
	<ul class="st-related-posts">
	<li><a href="http://www.ghacks.net/2009/04/01/help-i-use-ubuntu-and-theres-no-su/" title="Help, I Use Ubuntu and There&#8217;s No &#8220;su&#8221;! (April 1, 2009)">Help, I Use Ubuntu and There&#8217;s No &#8220;su&#8221;!</a> (4)</li>
	<li><a href="http://www.ghacks.net/2008/02/07/yoggie-pico-personal-mobile-security-computer/" title="Yoggie PICO Personal Mobile Security Computer (February 7, 2008)">Yoggie PICO Personal Mobile Security Computer</a> (3)</li>
	<li><a href="http://www.ghacks.net/2009/10/30/with-ubuntu-9-10-arrives-wubi-9-10/" title="With Ubuntu 9.10 Arrives Wubi 9.10 (October 30, 2009)">With Ubuntu 9.10 Arrives Wubi 9.10</a> (2)</li>
	<li><a href="http://www.ghacks.net/2006/12/07/widgets-for-linux-superkaramba/" title="Widgets for Linux: SuperKaramba (December 7, 2006)">Widgets for Linux: SuperKaramba</a> (6)</li>
	<li><a href="http://www.ghacks.net/2006/12/06/widgets-for-linux-gdesklets/" title="Widgets for Linux: gDesklets (December 6, 2006)">Widgets for Linux: gDesklets</a> (3)</li>
</ul>

]]></content:encoded>
			<wfw:commentRss>http://www.ghacks.net/2009/06/24/give-users-specific-access-with-sudo/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
	</channel>
</rss>
