<?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>Person @ CREATIVEDESK &#187; SSH</title>
	<atom:link href="http://hardik.in/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://hardik.in</link>
	<description>Hardik Dalwadi</description>
	<lastBuildDate>Fri, 06 Jan 2012 10:04:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.2</generator>
		<item>
		<title>SSH Tips and Tricks</title>
		<link>http://hardik.in/2009/06/25/ssh-tips-and-tricks/#utm_source=feed&#038;utm_medium=feed&#038;utm_campaign=feed</link>
		<comments>http://hardik.in/2009/06/25/ssh-tips-and-tricks/#comments</comments>
		<pubDate>Thu, 25 Jun 2009 18:47:47 +0000</pubDate>
		<dc:creator>Hardik Dalwadi</dc:creator>
				<category><![CDATA[Archives]]></category>
		<category><![CDATA[GNU / Linux]]></category>
		<category><![CDATA[Time Pass]]></category>
		<category><![CDATA[SSH]]></category>
		<category><![CDATA[Tips]]></category>
		<category><![CDATA[Tricks]]></category>

		<guid isPermaLink="false">http://hardik.in/?p=34</guid>
		<description><![CDATA[Many of you know that how to do password less login with SSH. Here is simple way to do that. First of all, please generate authentication keys for ssh by using ssh-keygen command. #ssh-keygen -t dsa Above command will generate authentication keys for ssh in our home directory. For password less login we need &#8216;id_dsa.pub&#8217; [...]]]></description>
			<content:encoded><![CDATA[<p><cite>Many of you know that how to do password less login with SSH.<br />
Here is simple way to do that. First of all, please generate authentication keys for ssh by using <a href="http://www.linuxmanpages.com/man1/ssh-keygen.1.php">ssh-keygen</a> command.</p>
<pre>#ssh-keygen -t dsa</pre>
<p>Above command will generate authentication keys for ssh in our home directory. For password less login we need &#8216;id_dsa.pub&#8217; file. Now we have to transfer this key to our server where we have to enable public key authentication. ssh-copy-id is best friend to copy that key to our server&#8217;s ~.ssh/authorized_keys file.</p>
<pre>#ssh-copy-id -i /root/.ssh/id_dsa.pub person@CREATIVEDESKDESK</pre>
<p>After giving password it will copy those key to our server. That&#8217;s it, you have enable your password less login from your Linux<br />
Laptop/Desktop to your server. Just ssh to our server to see the magic.</p>
<pre>#ssh person@CREATIVEDESKDESK</pre>
<p>If you want to know other way to do this, i will recomend to visit <a href="http://www.biostat.jhsph.edu/bit/nopassword.html<br />
"> [1] </a> befor going further.</p>
<p>[1] http://www.biostat.jhsph.edu/bit/nopassword.html</p>
<p>Now my magic will start from here. For example, one often needs to log in to servers  CREATIVEDESK, red, green, blue.</p>
<p>  1. create a simple script called &#8216;ssh-to-server&#8217; and put it in<br />
     /usr/local/sbin:</p>
<pre>      #! /bin/bash

     ssh `basename $0` $*</pre>
<p>  2. create symlinks with names of the servers:</p>
<pre>      # cd /usr/local/sbin

     # chmod 0755 ssh-to-server

     # ln -s ssh-to-server CREATIVEDESK

     # ln -s ssh-to-server red

     # ln -s ssh-to-server green

     # ln -s ssh-to-server blue</pre>
<p>Then (if your path includes /usr/local/sbin) one can simply ssh to &#8216;CREATIVEDESK&#8217; server by typing &#8216;CREATIVEDESK&#8217; (or run a command on the &#8216;CREATIVEDESK&#8217; server by &#8216;CREATIVEDESK uptime&#8217;). If the servers need to be accessed by fully qualified domain name, symbolic link to the ssh-to-server script to the FQDN.</p>
<p>Examples,</p>
<p>1. Server&#8217;s uptime</p>
<pre>#CREATIVEDESK uptime
 18:34:28 up 62 days, 22:49,  2 users,  load average: 0.12, 0.05, 0.01</pre>
<p>2. Copy sinlge or multiple file with or without archive</p>
<p>Transfering Single file:</p>
<pre># cat foo | CREATIVEDESK cat > foo</pre>
<p>Transfering Multiple files with archive in desire remote location:</p>
<pre>#tar -c -f - bar | CREATIVEDESK "cd /tmp; tar -x -f -"</pre>
<p>You can find lot SSH Tips and Tricks on the internet. I have a good <a href="http://www.dearm.co.uk/cotwssh/" class="broken_link">reference </a> for you.</p>
<p>That&#8217;s all for now&#8230;<br />
</cite></p>
]]></content:encoded>
			<wfw:commentRss>http://hardik.in/2009/06/25/ssh-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

