<?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>HandsomePlanet &#187; sudo</title>
	<atom:link href="http://www.handsomeplanet.com/archives/tag/sudo/feed" rel="self" type="application/rss+xml" />
	<link>http://www.handsomeplanet.com</link>
	<description>technology and other perplexities</description>
	<lastBuildDate>Mon, 19 Sep 2011 16:22:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>un-ubuntuing visudo: how to make visudo use vi instead of nano</title>
		<link>http://www.handsomeplanet.com/archives/60</link>
		<comments>http://www.handsomeplanet.com/archives/60#comments</comments>
		<pubDate>Thu, 18 Jun 2009 22:44:41 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[tech]]></category>
		<category><![CDATA[sudo]]></category>
		<category><![CDATA[ubuntu]]></category>
		<category><![CDATA[vi]]></category>

		<guid isPermaLink="false">http://www.handsomeplanet.com/?p=60</guid>
		<description><![CDATA[At some point, Ubuntu decided that it was best to have &#8220;visudo&#8221; &#8212; which refers to the vi editor by name &#8212; use the nano editor by default. If, like me, you are trying to edit the sudoers file, and you don&#8217;t want to use nano, or if you want to change visudo &#8220;back&#8221; to [...]]]></description>
			<content:encoded><![CDATA[<p>At some point, Ubuntu decided that it was best to have &#8220;visudo&#8221; &#8212; which refers to the vi editor by name &#8212; use the nano editor by default.  If, like me, you are trying to edit the sudoers file, and you don&#8217;t want to use nano, or if you want to change visudo &#8220;back&#8221; to using vi (as intended), then read on.  Note that this also will change your default editor to vi, or change the default to whatever editor you choose.</p>
<p>visudo takes its cue from the alternatives configuration system, which means it looks to /usr/bin/editor, which itself points to /etc/alternatives/editor.</p>
<p>The Ubuntu way to change the default editor (which will be used by visudo) then is to run</p>
<p><code>update-alternatives --config editor</code></p>
<p>That should go something like this:<br />
<code><br />
laptop:~$ sudo update-alternatives --config editor<br />[sudo] password for obelix: </p>
<p></code><br />
<code>There are 6 alternatives which provide `editor'.</p>
<p>&nbsp;</code><code> Selection&nbsp;&nbsp;&nbsp; Alternative<br />-----------------------------------------------</code><br /></code><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 1&nbsp;&nbsp;&nbsp; /usr/bin/vim.tiny<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 2&nbsp;&nbsp;&nbsp; /bin/ed<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 3&nbsp;&nbsp;&nbsp; /bin/nano<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 4&nbsp;&nbsp;&nbsp; /usr/bin/vim.basic<br />*+&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;5&nbsp;&nbsp;&nbsp; /usr/bin/vim.gnome<br /><code>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; 6&nbsp;&nbsp;&nbsp; /usr/bin/mcedit-debian</p>
<p></code><code>Press enter to keep the default[*], or type selection number: 1<br />Using '/usr/bin/vim.tiny' to provide 'editor'.<br />laptop:~$ </p>
<p></code></p>
<p>Finally, here's what the filesystem structure looks like:</p>
<p><code><br />
laptop:~$ ls -l /usr/bin/editor<br />
lrwxrwxrwx 1 root root 24 2008-12-17 14:57 /usr/bin/editor -&gt; /etc/alternatives/editor<br />
laptop:~$ ls -l /etc/alternatives/editor<br />
lrwxrwxrwx 1 root root 18 2009-04-23 17:32 /etc/alternatives/editor -&gt; /usr/bin/vim.tiny<br />
</code></p>
<div id="_mcePaste" style="overflow: hidden; position: absolute; left: -10000px; top: 171px; width: 1px; height: 1px;">laptop:~$ sudo update-alternatives --config editor<br />
[sudo] password for :</p>
<p>There are 6 alternatives which provide `editor'.</p>
<p>Selection    Alternative<br />
-----------------------------------------------<br />
1    /usr/bin/vim.tiny<br />
2    /bin/ed<br />
3    /bin/nano<br />
4    /usr/bin/vim.basic<br />
*+        5    /usr/bin/vim.gnome<br />
6    /usr/bin/mcedit-debian</p>
<p>Press enter to keep the default[*], or type selection number: 1<br />
Using '/usr/bin/vim.tiny' to provide 'editor'.<br />
laptop:~$</p></div>
]]></content:encoded>
			<wfw:commentRss>http://www.handsomeplanet.com/archives/60/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

