<?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>WiredRevolution.com &#187; sudo</title>
	<atom:link href="http://www.wiredrevolution.com/tag/sudo/feed" rel="self" type="application/rss+xml" />
	<link>http://www.wiredrevolution.com</link>
	<description>A Bit of Linux Wisdom</description>
	<lastBuildDate>Wed, 18 Jan 2012 22:45:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
		<item>
		<title>Allow sudo access without passwords in Ubuntu</title>
		<link>http://www.wiredrevolution.com/ubuntu/allow-sudo-access-without-passwords-in-ubuntu?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=allow-sudo-access-without-passwords-in-ubuntu</link>
		<comments>http://www.wiredrevolution.com/ubuntu/allow-sudo-access-without-passwords-in-ubuntu#comments</comments>
		<pubDate>Fri, 21 Nov 2008 13:51:28 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[8.10]]></category>
		<category><![CDATA[intrepid]]></category>
		<category><![CDATA[NOPASSWD]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[sudoers]]></category>
		<category><![CDATA[visudo]]></category>

		<guid isPermaLink="false">http://www.wiredrevolution.com/?p=695</guid>
		<description><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/ubuntu_icon.png" width="80" height="78" alt="" title="ubuntu" /><br/>To give a specific user access to sudo without having to enter a password you have to edit the /etc/sudoers configuration file. For security reasons you should only edit the file using the visudo command. $ sudo visudo In Ubuntu the following lines are placed at the bottom of /etc/sudoers by default. This gives your [...]


Related posts<ol><li><a href='http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo' rel='bookmark' title='Permanent Link: Submit commands as root with sudo'>Submit commands as root with sudo</a></li>
<li><a href='http://www.wiredrevolution.com/ubuntu/how-to-ssh-into-ubuntu-livecd' rel='bookmark' title='Permanent Link: How to SSH into Ubuntu LiveCD'>How to SSH into Ubuntu LiveCD</a></li>
<li><a href='http://www.wiredrevolution.com/system-administration/share-a-remote-filesystem-over-ssh' rel='bookmark' title='Permanent Link: Share a remote filesystem over SSH'>Share a remote filesystem over SSH</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/ubuntu_icon.png" width="80" height="78" alt="" title="ubuntu" /><br/><p>To give a specific user access to sudo without having to enter a password you have to edit the <strong>/etc/sudoers</strong> configuration file.  For security reasons you should only edit the file using the <strong>visudo</strong> command.</p>
<pre>
$ sudo visudo
</pre>
<p>In Ubuntu the following lines are placed at the bottom of <strong>/etc/sudoers</strong> by default. This gives your default user access to sudo as well as any other user in the admin group. </p>
<pre>
# Members of the admin group may gain root privileges
%admin ALL=(ALL) ALL
</pre>
<p>If you want to allow sudo access without passwords for all users in the admin group you can simply add the <strong>NOPASSWD</strong> option to this line and be done.</p>
<pre>
%admin ALL=(ALL) NOPASSWD: ALL
</pre>
<p>If you want to give a specific user sudo access without passwords, you will have to add an additional line for each user. These lines will conflict with the default admin line above so they <strong>must be placed at the end</strong> of the sudoers file. The reason for this is that sudo will handle contradicting configuration lines by giving priority to the line closest to the bottom of the file.  </p>
<p>Add the following line to the <strong>end</strong> of the file, replace &#8216;ryan&#8217; with your username.</p>
<pre>
ryan    ALL=(ALL) NOPASSWD: ALL
</pre>
<p>Add a line for each user that you wish to have access.</p>
<p>For more ways to use and configure sudo have a look <a href="http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo">here</a>.</p>


<p>Related posts<ol><li><a href='http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo' rel='bookmark' title='Permanent Link: Submit commands as root with sudo'>Submit commands as root with sudo</a></li>
<li><a href='http://www.wiredrevolution.com/ubuntu/how-to-ssh-into-ubuntu-livecd' rel='bookmark' title='Permanent Link: How to SSH into Ubuntu LiveCD'>How to SSH into Ubuntu LiveCD</a></li>
<li><a href='http://www.wiredrevolution.com/system-administration/share-a-remote-filesystem-over-ssh' rel='bookmark' title='Permanent Link: Share a remote filesystem over SSH'>Share a remote filesystem over SSH</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.wiredrevolution.com/ubuntu/allow-sudo-access-without-passwords-in-ubuntu/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disable ext3 boot-time check with tune2fs</title>
		<link>http://www.wiredrevolution.com/system-administration/disable-ext3-boot-time-check-with-tune2fs?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=disable-ext3-boot-time-check-with-tune2fs</link>
		<comments>http://www.wiredrevolution.com/system-administration/disable-ext3-boot-time-check-with-tune2fs#comments</comments>
		<pubDate>Sun, 26 Oct 2008 19:09:18 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[system administration]]></category>
		<category><![CDATA[boot]]></category>
		<category><![CDATA[ext3]]></category>
		<category><![CDATA[filesystem]]></category>
		<category><![CDATA[fsck]]></category>
		<category><![CDATA[livecd]]></category>
		<category><![CDATA[partition]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[tune2fs]]></category>

		<guid isPermaLink="false">http://www.wiredrevolution.com/?p=520</guid>
		<description><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/sysadmin_icon.png" width="80" height="94" alt="" title="system administration" /><br/>The ext3 file system forces an fsck once it has been mounted a certain number of times. By default this maximum mount count is usually set between 20-30. On many systems such as laptops which can be rebooted quite often this can quickly become a problem. To turn off this checking you can use the [...]


Related posts<ol><li><a href='http://www.wiredrevolution.com/system-administration/free-ext3-reserved-blocks-with-tune2fs' rel='bookmark' title='Permanent Link: Free ext3 reserved blocks with tune2fs'>Free ext3 reserved blocks with tune2fs</a></li>
<li><a href='http://www.wiredrevolution.com/system-administration/install-the-grub-boot-loader-to-the-mbr' rel='bookmark' title='Permanent Link: Install the GRUB boot loader to the MBR'>Install the GRUB boot loader to the MBR</a></li>
<li><a href='http://www.wiredrevolution.com/suse/enable-or-disable-boot-time-services-in-suse' rel='bookmark' title='Permanent Link: Enable or disable boot time services in SUSE'>Enable or disable boot time services in SUSE</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/sysadmin_icon.png" width="80" height="94" alt="" title="system administration" /><br/><p>The <strong>ext3</strong> file system forces an <strong>fsck</strong> once it has been mounted a certain number of times. By default this maximum mount count is usually set between 20-30.  On many systems such as laptops which can be rebooted quite often this can quickly become a problem. To turn off this checking you can use the <strong>tune2fs</strong> command.</p>
<p>The tune2fs command utility operates exclusively on ext2/ext3 file systems.</p>
<p>To run these commands you must run the command as root or <a href="http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo">use sudo</a>. You must also <strong>make sure that your filesystem is unmounted before making any changes</strong>. If you are doing this on your root partition the best solution is to use a LiveCD.</p>
<p>You can run tune2fs on the ext3 partition with the &#8216;<strong>-l</strong>&#8216; option to view what your current and maximum mount count is set to currently.</p>
<pre>
tune2fs -l /dev/sda1
</pre>
<pre>
...
Mount count:              2
Maximum mount count:      25
...
</pre>
<p>To turn off this check set the maximum count to 0 with the &#8216;<strong>-c</strong>&#8216; option.</p>
<pre>
# tune2fs -c 0 /dev/sda1
</pre>
<p>If you do not want to completely disable the file system checking, you can also increase the maximum count.</p>
<pre>
# tune2fs -c 100 /dev/sda1
</pre>


<p>Related posts<ol><li><a href='http://www.wiredrevolution.com/system-administration/free-ext3-reserved-blocks-with-tune2fs' rel='bookmark' title='Permanent Link: Free ext3 reserved blocks with tune2fs'>Free ext3 reserved blocks with tune2fs</a></li>
<li><a href='http://www.wiredrevolution.com/system-administration/install-the-grub-boot-loader-to-the-mbr' rel='bookmark' title='Permanent Link: Install the GRUB boot loader to the MBR'>Install the GRUB boot loader to the MBR</a></li>
<li><a href='http://www.wiredrevolution.com/suse/enable-or-disable-boot-time-services-in-suse' rel='bookmark' title='Permanent Link: Enable or disable boot time services in SUSE'>Enable or disable boot time services in SUSE</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.wiredrevolution.com/system-administration/disable-ext3-boot-time-check-with-tune2fs/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>List all open files with lsof</title>
		<link>http://www.wiredrevolution.com/commands/list-all-open-files-with-lsof?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=list-all-open-files-with-lsof</link>
		<comments>http://www.wiredrevolution.com/commands/list-all-open-files-with-lsof#comments</comments>
		<pubDate>Sat, 25 Oct 2008 04:32:10 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[commands]]></category>
		<category><![CDATA[lsof]]></category>
		<category><![CDATA[sudo]]></category>

		<guid isPermaLink="false">http://www.wiredrevolution.com/?p=496</guid>
		<description><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/commands_icon.png" width="80" height="69" alt="" title="commands" /><br/>The lsof command stands for &#8220;list open files&#8221;. It can show all open files as well as sockets, memory mapped libraries, directories, pipes, and network sockets. It is an incredibly powerful tool which you can use to gather detailed information about what is happening on your system. If you run lsof as a normal user [...]


Related posts<ol><li><a href='http://www.wiredrevolution.com/commands/search-for-files-with-the-find-command' rel='bookmark' title='Permanent Link: Search for files with the find command'>Search for files with the find command</a></li>
<li><a href='http://www.wiredrevolution.com/commands/securely-copy-remote-files-with-scp' rel='bookmark' title='Permanent Link: Securely copy remote files with scp'>Securely copy remote files with scp</a></li>
<li><a href='http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo' rel='bookmark' title='Permanent Link: Submit commands as root with sudo'>Submit commands as root with sudo</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/commands_icon.png" width="80" height="69" alt="" title="commands" /><br/><p>The lsof command stands for &#8220;list open files&#8221;. It can show all open files as well as sockets, memory mapped libraries, directories, pipes, and network sockets.  It is an incredibly powerful tool which you can use to gather detailed information about what is happening on your system.</p>
<p>If you run lsof as a normal user you will be limited to only the the processes owned by that user.  To get system wide results you must run the command as root or <a href="http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo">use sudo</a>.</p>
<p>Running the command by itself will show information for all active process on the system.</p>
<pre>
# lsof
</pre>
<pre>
COMMAND    PID   USER   FD      TYPE             DEVICE     SIZE       NODE NAME
lsof    7289 root  cwd    DIR    8,3    4096  6504451 /home/ryan
lsof    7289 root  rtd    DIR    8,3    4096        2 /
lsof    7289 root  txt    REG    8,3  110280 11178207 /usr/bin/lsof
lsof    7289 root  mem    REG    8,3  114952 11504968 /lib64/ld-2.6.1.so
lsof    7289 root  mem    REG    8,3 1293456 11504986 /lib64/libc-2.6.1.so
lsof    7289 root    0u   CHR  136,1                3 /dev/pts/1
lsof    7289 root    1u   CHR  136,1                3 /dev/pts/1
lsof    7289 root    2u   CHR  136,1                3 /dev/pts/1
lsof    7289 root    3r   DIR    0,3       0        1 /proc
lsof    7289 root    4r   DIR    0,3       0    19745 /proc/7289/fd
lsof    7289 root    5w  FIFO    0,5            19759 pipe
lsof    7289 root    6r  FIFO    0,5            19760 pipe
lsof    7290 root  cwd    DIR    8,3    4096  6504451 /home/ryan
lsof    7290 root  rtd    DIR    8,3    4096        2 /
lsof    7290 root  txt    REG    8,3  110280 11178207 /usr/bin/lsof
lsof    7290 root  mem    REG    8,3  114952 11504968 /lib64/ld-2.6.1.so
lsof    7290 root  mem    REG    8,3 1293456 11504986 /lib64/libc-2.6.1.so
lsof    7290 root    4r  FIFO    0,5            19759 pipe
lsof    7290 root    7w  FIFO    0,5            19760 pipe
...
</pre>
<p>As you can see in the previous output each open file is associated with its program and PID and has many attributes such as type, size, file descriptor, device, and inode number.</p>
<p>You can narrow the results down to an individual process.</p>
<pre>
# lsof -p 12345
</pre>
<p>You can get results for every process that is owned by a specific user.</p>
<pre>
# lsof -u ryan
</pre>
<p>This will give you detailed information about all network socket connections.</p>
<pre>
# lsof -i
</pre>
<p>You can narrow the results down to only TCP connections.</p>
<pre>
# lsof -i TCP
</pre>
<p>You can get information on a specific port.</p>
<pre>
# lsof -i :80
</pre>
<p>You can get information about all instances of a specific program </p>
<pre>
# lsof -c bash
</pre>
<p>This will show all files that are open within the &#8216;/tmp&#8217; directory.</p>
<pre>
# lsof +D /tmp
</pre>
<p>To get even more detailed output you can pipe these results to grep or use the &#8216;<strong>-a</strong>&#8216; option which combines any number of options.</p>
<p>For example you can view all network socket connections that are owned by the user ryan.</p>
<pre>
# lsof -a -i TCP -u ryan
</pre>


<p>Related posts<ol><li><a href='http://www.wiredrevolution.com/commands/search-for-files-with-the-find-command' rel='bookmark' title='Permanent Link: Search for files with the find command'>Search for files with the find command</a></li>
<li><a href='http://www.wiredrevolution.com/commands/securely-copy-remote-files-with-scp' rel='bookmark' title='Permanent Link: Securely copy remote files with scp'>Securely copy remote files with scp</a></li>
<li><a href='http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo' rel='bookmark' title='Permanent Link: Submit commands as root with sudo'>Submit commands as root with sudo</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.wiredrevolution.com/commands/list-all-open-files-with-lsof/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Update your entire Gentoo Linux system</title>
		<link>http://www.wiredrevolution.com/gentoo/update-your-entire-gentoo-linux-system?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=update-your-entire-gentoo-linux-system</link>
		<comments>http://www.wiredrevolution.com/gentoo/update-your-entire-gentoo-linux-system#comments</comments>
		<pubDate>Fri, 10 Oct 2008 12:42:55 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[gentoo]]></category>
		<category><![CDATA[emerge]]></category>
		<category><![CDATA[gentoolkit]]></category>
		<category><![CDATA[make.conf]]></category>
		<category><![CDATA[oneshot]]></category>
		<category><![CDATA[parallel-fetch]]></category>
		<category><![CDATA[portage]]></category>
		<category><![CDATA[revdep-rebuild]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[sync]]></category>
		<category><![CDATA[USE flags]]></category>
		<category><![CDATA[world]]></category>

		<guid isPermaLink="false">http://www.wiredrevolution.com/?p=264</guid>
		<description><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/gentoo_icon.png" width="80" height="82" alt="" title="gentoo" /><br/>Gentoo Portage makes it fairly easy to update all the installed packages on your system. The emerge and revdep-rebuild tools are powerful and make the process of recompiling everything much less painful than it sounds. The emerge and revdep-rebuild commands require root privileges so switch to root or use sudo. The first step is to [...]


Related posts<ol><li><a href='http://www.wiredrevolution.com/gentoo/speed-up-gentoo-emerge-with-parallel-fetch' rel='bookmark' title='Permanent Link: Speed up Gentoo emerge with &#8220;parallel-fetch&#8221;'>Speed up Gentoo emerge with &#8220;parallel-fetch&#8221;</a></li>
<li><a href='http://www.wiredrevolution.com/gentoo/install-java-browser-plugin-gentoo' rel='bookmark' title='Permanent Link: Install Java browser plugin in Gentoo'>Install Java browser plugin in Gentoo</a></li>
<li><a href='http://www.wiredrevolution.com/gentoo/view-the-status-of-a-long-emerge' rel='bookmark' title='Permanent Link: View the status of a long emerge'>View the status of a long emerge</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/gentoo_icon.png" width="80" height="82" alt="" title="gentoo" /><br/><p>Gentoo Portage makes it fairly easy to update all the installed packages on your system. The emerge and revdep-rebuild tools are powerful and make the process of recompiling everything much less painful than it sounds.</p>
<p>The emerge and revdep-rebuild commands require root privileges so switch to root or <a href="http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo">use sudo</a>.</p>
<p>The first step is to synchronize your Portage tree with the latest mirror.  This command will get you information on the latest packages that are currently available. </p>
<pre>
# emerge --sync
</pre>
<p>Perform an &#8220;pretend&#8221; emerge to see what packages will be updated and installed on your system.</p>
<pre>
# emerge -uDNvp world
</pre>
<pre>
These are the packages that would be merged, in order:

Calculating world dependencies... done!
[ebuild     U ] dev-util/pkgconfig-0.23 [0.22] USE="-hardened" 1,009 kB
[ebuild     U ] media-sound/wavpack-4.50.1 [4.41.0] USE="mmx" 367 kB
[ebuild     U ] dev-libs/gmp-4.2.2-r2 [4.2.2] USE="-doc -nocxx" 0 kB
.
.
.
[ebuild  N    ] sys-apps/man-pages-posix-2003a  949 kB 

Total: 149 packages (100 upgrades, 36 new, 2 in new slots, 11 reinstalls), Size of downloads: 354,800 kB
</pre>
<p>Lets go over these options.</p>
<p><strong>-u</strong> update packages<br />
<strong>-D</strong> consider entire dependency tree for all packages<br />
<strong>-N</strong> include packages with USE flag changes<br />
<strong>-v</strong> verbose emerge output<br />
<strong>-p</strong> pretend to do the emerge</p>
<p>The &#8216;<strong>world</strong>&#8216; argument tells emerge to use the list of packages in your world file.  This list contains all packages that have been directly emerged on your system.  These packages do not include dependences or packages that were emerged using the &#8216;<strong>&#8211;oneshot</strong>&#8216; option. Your world file is located here <strong>/var/lib/portage/world</strong>.</p>
<p>The output of this command will tell you one of two things.  Either everything is good and you can go ahead and perform the update, or Portage has found some conflicts such as blocking packages that must be fixed before you continue. Hopefully the former is the case, but if there are conflicts Portage messages will usually point you in the right direction.</p>
<p>Before performing the actual update you can <a href="http://www.wiredrevolution.com/gentoo/speed-up-gentoo-emerge-with-parallel-fetch">use the parallel-fetch feature</a> to speed up the package downloads and shorten the update process. To do this add the following line to <strong>/etc/make.conf</strong>.</p>
<pre>
FEATURES="parallel-fetch"
</pre>
<p>If there are no Portage issues, you have reviewed the list of packages to be installed and everything looks correct, then you can start the update. To perform the update run the same command as before but remove the &#8216;<strong>-p</strong>&#8216; option.</p>
<pre>
# emerge -uDNv world
</pre>
<p>Occasionally a system update will break shared library dependencies as an upgraded package may no longer be compatible with packages which use it. Enter the <strong>revdep-rebuild</strong> reverse dependency re-builder tool. </p>
<p>The revdep-rebuild tool is part of the <strong>gentoolkit</strong> package which you must emerge first.</p>
<p>Run this command after a large system update to ensure all packages are in good shape.</p>
<pre>
# revdep-rebuild
</pre>
<p>This command will scan your system for missing shared library dependencies and fix them by re-emerging those missing packages.</p>


<p>Related posts<ol><li><a href='http://www.wiredrevolution.com/gentoo/speed-up-gentoo-emerge-with-parallel-fetch' rel='bookmark' title='Permanent Link: Speed up Gentoo emerge with &#8220;parallel-fetch&#8221;'>Speed up Gentoo emerge with &#8220;parallel-fetch&#8221;</a></li>
<li><a href='http://www.wiredrevolution.com/gentoo/install-java-browser-plugin-gentoo' rel='bookmark' title='Permanent Link: Install Java browser plugin in Gentoo'>Install Java browser plugin in Gentoo</a></li>
<li><a href='http://www.wiredrevolution.com/gentoo/view-the-status-of-a-long-emerge' rel='bookmark' title='Permanent Link: View the status of a long emerge'>View the status of a long emerge</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.wiredrevolution.com/gentoo/update-your-entire-gentoo-linux-system/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Submit commands as root with sudo</title>
		<link>http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo?utm_source=rss&#038;utm_medium=rss&#038;utm_campaign=submit-commands-as-root-with-sudo</link>
		<comments>http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo#comments</comments>
		<pubDate>Wed, 01 Oct 2008 13:31:05 +0000</pubDate>
		<dc:creator>Ryan</dc:creator>
				<category><![CDATA[commands]]></category>
		<category><![CDATA[NOPASSWD]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[sudoers]]></category>
		<category><![CDATA[visudo]]></category>

		<guid isPermaLink="false">http://www.wiredrevolution.com/?p=167</guid>
		<description><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/commands_icon.png" width="80" height="69" alt="" title="commands" /><br/>Among the most valuable tools at a Linux administrators disposal is sudo. It lets ordinary users temporarily submit commands as root or another user. To use use this command simply put sudo before any command you want to run with root permissions. sudo command To submit commands as another user use the &#8216;-u&#8216; option and [...]


Related posts<ol><li><a href='http://www.wiredrevolution.com/ubuntu/allow-sudo-access-without-passwords-in-ubuntu' rel='bookmark' title='Permanent Link: Allow sudo access without passwords in Ubuntu'>Allow sudo access without passwords in Ubuntu</a></li>
<li><a href='http://www.wiredrevolution.com/commands/list-all-open-files-with-lsof' rel='bookmark' title='Permanent Link: List all open files with lsof'>List all open files with lsof</a></li>
<li><a href='http://www.wiredrevolution.com/essential-linux-commands' rel='bookmark' title='Permanent Link: Essential Linux Commands'>Essential Linux Commands</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<img src="http://www.wiredrevolution.com/wp-content/uploads/commands_icon.png" width="80" height="69" alt="" title="commands" /><br/><p>Among the most valuable tools at a Linux administrators disposal is sudo.  It lets ordinary users temporarily submit commands as root or another user.</p>
<p>To use use this command simply put sudo before any command you want to run with root permissions.</p>
<pre>
sudo <em>command</em>
</pre>
<p>To submit commands as another user use the &#8216;<strong>-u</strong>&#8216; option and the username. This will submit a command as the user ryan.</p>
<pre>
sudo -u ryan <em>command</em>
</pre>
<p>The sudo configuration file is located at <strong>/etc/sudoers</strong>.</p>
<p>Although /etc/sudoers file is a regular text which root can edit manually, it is recommended that you only edit it using <strong>visudo</strong>. The visudo editor locks the sudoers file against multiple simultaneous edits, provides basic sanity checks, and checks for errors.</p>
<p>The /etc/sudoers file has the general format:</p>
<pre>
user hostlist = (userlist) commandlist
</pre>
<p>This is a basic configuration and will allow the user ryan to run any command, on any host, as any user.</p>
<pre>
# User privilege specification
root    ALL=(ALL) ALL
ryan    ALL=(ALL) ALL
</pre>
<p>Here is a more complex example.</p>
<pre>
ryan     tuxbox=(bob, bill)   /bin/kill
</pre>
<p>This will give ryan access to run &#8220;kill&#8221; as the users bob and bill using &#8220;sudo -u&#8221; on the host &#8220;tuxbox&#8221;.</p>
<p>When using the above configurations you will be prompted for ryan&#8217;s password before sudo will execute your command. After the pasword is accepted, you will have a 5 minute window to submit other commands without further password requests.</p>
<p>Submitting a password has its security benefits, but if you are ok without it, there is a way around this inconvenience. If you don&#8217;t want to enter a password add the <strong>NOPASSWD</strong> tag to the configuration file like this.</p>
<pre>
# User privilege specification
root    ALL=(ALL) ALL
ryan    ALL=(ALL) NOPASSWD: ALL
</pre>
<p>If there are configuration lines that contradict one another sudo will give priority to the line closest to the bottom of the file. So if you make changes and they don&#8217;t seem to take effect, check that this is not the case.</p>
<p>All calls to sudo are logged in <strong>/var/log/messages</strong> so you have the ability to keep track of who did what on the system.</p>


<p>Related posts<ol><li><a href='http://www.wiredrevolution.com/ubuntu/allow-sudo-access-without-passwords-in-ubuntu' rel='bookmark' title='Permanent Link: Allow sudo access without passwords in Ubuntu'>Allow sudo access without passwords in Ubuntu</a></li>
<li><a href='http://www.wiredrevolution.com/commands/list-all-open-files-with-lsof' rel='bookmark' title='Permanent Link: List all open files with lsof'>List all open files with lsof</a></li>
<li><a href='http://www.wiredrevolution.com/essential-linux-commands' rel='bookmark' title='Permanent Link: Essential Linux Commands'>Essential Linux Commands</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://www.wiredrevolution.com/commands/submit-commands-as-root-with-sudo/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

