<?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>/home/spsneo/blog &#187; SSH</title>
	<atom:link href="http://spsneo.com/blog/category/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://spsneo.com/blog</link>
	<description>Trying to move every bit to cloud.</description>
	<lastBuildDate>Fri, 19 Aug 2011 16:43:37 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Reusing SSH connection</title>
		<link>http://spsneo.com/blog/2008/08/25/reusing-ssh-connection/</link>
		<comments>http://spsneo.com/blog/2008/08/25/reusing-ssh-connection/#comments</comments>
		<pubDate>Mon, 25 Aug 2008 14:21:15 +0000</pubDate>
		<dc:creator>spsneo</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Connection]]></category>
		<category><![CDATA[Socket]]></category>

		<guid isPermaLink="false">http://spsneo.com/blog/?p=45</guid>
		<description><![CDATA[Very often, while working on a network node via SSH, we need multiple connections to the same node. For example, say you are connected to a node A, and then you need to transfer a file to the same node &#8230; <a href="http://spsneo.com/blog/2008/08/25/reusing-ssh-connection/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Very often, while working on a network node via SSH, we need multiple connections to the same node. For example, say you are connected to a node A, and then you need to transfer a file to the same node from your local machine. Then we have to <strong><em>scp</em></strong>, which establishes a fresh connection to that machine and one has to enter the password again. So, it takes some time as well as it is irritating to enter password again and again.</p>
<p>Here&#8217;s the remedy :</p>
<p>Open the file  /etc/ssh/ssh_config  on your local machine as root to edit. Or if you are not the root user, you can create a file  ~/.ssh/config  for user level SSH configurations.</p>
<p>Add the following lines at the end of the file you opened just now:</p>
<p><code> ControlMaster auto </code><br />
<code> ControlPath /tmp/ssh-%r@%h:%p </code></p>
<p>Save the file and you are done !!</p>
<p>Now check out (One can try it this way) -Open a terminal and connect to a server :</p>
<p><code> $ ssh s.siddharth@202.141.81.145 </code></p>
<p>The connection gets established after entering the proper password. </p>
<p>Then in another terminal try to copy a file from your local machine to the same server :</p>
<p><code> $ scp -r ~/pintos s.siddharth@202.141.81.145 </code></p>
<p>This time, you don&#8217;t need to wait for a fresh connection, neither you will have to enter the password again. File transfer starts instantaneously. SSH shared the already established connection.<br />
Similarly you can open another terminal without waiting and entering the password again. </p>
<p>One can check out more configurations for SSH by checking out the man pages of ssh_config<br />
<code>$ man ssh_config </code></p>
<p>Hope you liked this tip !!</p>
]]></content:encoded>
			<wfw:commentRss>http://spsneo.com/blog/2008/08/25/reusing-ssh-connection/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

