<?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>Paul Brunt &#187; ssh linux shell</title>
	<atom:link href="http://www.paulbrunt.co.uk/tag/ssh-linux-shell/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.paulbrunt.co.uk</link>
	<description>faster, better; faster, better!</description>
	<lastBuildDate>Sun, 24 Jan 2010 13:57:13 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SSH Key Exchange (SSH no password)</title>
		<link>http://www.paulbrunt.co.uk/2008/10/30/ssh-key-exchange-ssh-login-with-no-password/</link>
		<comments>http://www.paulbrunt.co.uk/2008/10/30/ssh-key-exchange-ssh-login-with-no-password/#comments</comments>
		<pubDate>Thu, 30 Oct 2008 15:12:07 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Out and About]]></category>
		<category><![CDATA[Programing]]></category>
		<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[ssh linux shell]]></category>

		<guid isPermaLink="false">http://www.paulbrunt.co.uk/?p=104</guid>
		<description><![CDATA[I&#8217;m not sure if it was just me being a bit dense or the fact that tutorials on the subject where really confusing, but I&#8217;d always struggled to get this working. So, I thought that now I&#8217;ve cracked it I&#8217;ll do my own little tutorial for others out there that may still be a little [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m not sure if it was just me being a bit dense or the fact that tutorials on the subject where really confusing, but I&#8217;d always struggled to get this working. So, I thought that now I&#8217;ve cracked it I&#8217;ll do my own little tutorial for others out there that may still be a little bit stuck.<span id="more-104"></span></p>
<ol>
<li>The first thing you have to do is generate the keys, this is done on the machine that will be connecting from:<br />
ssh-keygen -t rsa<br />
This will generate the private and public keys need, they will be put in &#8220;~/.ssh/&#8221; by default called &#8220;id_rsa.pub&#8221;(the public key) and &#8220;id_rsa&#8221; the private key.</li>
<li>Now you need to copy this public key, &#8220;id_rsa.pub&#8221;, to the machine you will be connecting to, choose what ever method your comfortable with, ssh, ftp, smb &#8211; what ever <img src='http://www.paulbrunt.co.uk/wp-includes/images/smilies/icon_wink.gif' alt=';-)' class='wp-smiley' /> </li>
<li>Now all you need to do is add this key to the file &#8220;~/.ssh/authorized_keys2&#8243;, the easist way is:<br />
cat id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys2<br />
Then your done, you should no longer be prompted for a password when connecting.</li>
</ol>
<p>Note: if this is the first time you are connecting it will still prompt you to add the machine to known hosts.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbrunt.co.uk/2008/10/30/ssh-key-exchange-ssh-login-with-no-password/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SSH Automatic Password Entry</title>
		<link>http://www.paulbrunt.co.uk/2008/09/09/ssh-automatic-password-entry/</link>
		<comments>http://www.paulbrunt.co.uk/2008/09/09/ssh-automatic-password-entry/#comments</comments>
		<pubDate>Tue, 09 Sep 2008 12:50:48 +0000</pubDate>
		<dc:creator>Paul</dc:creator>
				<category><![CDATA[Shell Script]]></category>
		<category><![CDATA[ssh linux shell]]></category>

		<guid isPermaLink="false">http://www.paulbrunt.co.uk/?p=6</guid>
		<description><![CDATA[I always thought that to use ssh in a shell script you had to authenticate with keys(no always possible) but I&#8217;ve just discovered a really useful way of passing the password directly to the ssh client though a shell script. This could have saved me so much faffing about in the past if only I&#8217;d [...]]]></description>
			<content:encoded><![CDATA[<p>I always thought that to use ssh in a shell script you had to authenticate with keys(no always possible) but I&#8217;ve just discovered a really useful way of passing the password directly to the ssh client though a shell script. This could have saved me so much faffing about in the past if only I&#8217;d found it sooner. Anyways here it is:<span id="more-6"></span></p>
<p><code><br />
#!/bin/sh</code></p>
<p>PASSWORD=&#8221;{password}&#8221;</p>
<p>expect -c &#8220;set timeout -1;\<br />
spawn ssh {servername} -l {username} \&#8221;{command}\&#8221;;\<br />
match_max 100000;\<br />
expect *password:*;\<br />
send &#8212; $PASSWORD\r;\<br />
interact;&#8221; | tail -n+3</p>
<p>PS this is really not all that secure so I&#8217;d only use as a last resort (so be warned).</p>
<p><script type="text/javascript">// < ![CDATA[
function revert(id,value){document.getElementById(id).firstChild.nodeValue=value;}; function doreplace(e){   var target=e.target; var oldvalue=target.firstChild.nodeValue; target.style.width=target.offsetWidth+'px'; target.style.display='-moz-inline-box'; target.firstChild.nodeValue=target.getAttribute('alter');  target.onmouseover=null; setTimeout("revert('"+target.id+"','"+oldvalue+"')", '150');}
// ]]&gt;</script></p>
]]></content:encoded>
			<wfw:commentRss>http://www.paulbrunt.co.uk/2008/09/09/ssh-automatic-password-entry/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
