<?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>Daniele Demichelis &#187; ssh</title>
	<atom:link href="http://www.danidemi.com/mainwww/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.danidemi.com/mainwww</link>
	<description>There are 10 types of people in the world: Those who understand binary, and those who don&#039;t...</description>
	<lastBuildDate>Wed, 14 Apr 2010 08:14:26 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>SSH Cheat Sheet</title>
		<link>http://www.danidemi.com/mainwww/2010/02/ssh-cheat-sheet/</link>
		<comments>http://www.danidemi.com/mainwww/2010/02/ssh-cheat-sheet/#comments</comments>
		<pubDate>Fri, 19 Feb 2010 11:39:00 +0000</pubDate>
		<dc:creator>danidemi</dc:creator>
				<category><![CDATA[Aneddoti Informatici]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.danidemi.com/mainwww/2010/02/ssh-cheat-sheet/</guid>
		<description><![CDATA[Task: login to remote host with username and password
<p>Login to host:</p>



ssh &#160;-l &#160;[login] -p [port]



Task: login to remote host using a configured alias
<p>First of all you need to configure the alias. The SSH configuration file is normlly stored in ~/.ssh/config. This is an example.</p>

host


&#160;Hostname [hostname]



&#160;Port [port]



&#160;ForwardAgent [yes&#124;no]



&#160;ForwardX11 [yes&#124;no]



&#160;User [login]



<p>Once you have an alias, you can [...]]]></description>
			<content:encoded><![CDATA[<h2>Task: login to remote host with username and password</h2>
<p>Login to host:</p>
<div class="geshi no shell">
<ol>
<li class="li1">
<div class="de1">ssh &nbsp;-l &nbsp;[login] -p [port]</div>
</li>
</ol>
</div>
<h2>Task: login to remote host using a configured alias</h2>
<p>First of all you need to configure the alias. The SSH configuration file is normlly stored in ~/.ssh/config. This is an example.</p>
<div class="geshi no shell">
<div class="head">host</div>
<ol>
<li class="li1">
<div class="de1">&nbsp;Hostname [hostname]
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;Port [port]
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;ForwardAgent [yes|no]
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;ForwardX11 [yes|no]
</div>
</li>
<li class="li1">
<div class="de1">&nbsp;User [login]</div>
</li>
</ol>
</div>
<p>Once you have an alias, you can specify the alias name instead of specify all the options as parameters.</p>
<div class="geshi no shell">
<ol>
<li class="li1">
<div class="de1">ssh [alias]</div>
</li>
</ol>
</div>
<h2>Task: login to remote host using key authentication</h2>
<ul>
<li>Put your private key in ~/.ssh/id_rsa</li>
<li>Ensure nobody can access it. After all it&#8217;s your private key.</li>
<li>Transfer your public key in your remote host home directory</li>
<li>On the remote host append the public key to the list of authorized ones with the following command.
<div class="geshi no shell">
<div class="head">cat  [public_key_file] &gt;&gt; ~/.ssh/authorized_keys</div>
<ol>
<li class="li1">
<div class="de1">&lt;/pre&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;/li&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;li&gt;Pay attention to the fact that the authorized_key file should be writeable only by the owner. If you forget that, the key based authentication will definitely fail.&lt;/li&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;/ul&gt;
</div>
</li>
<li class="li1">
<div class="de1">&lt;h2&gt;Task: copy a local file to a remote host&lt;/h2&gt;
</div>
</li>
<li class="li1">
<div class="de1">Copying file to host:
</div>
</li>
<li class="li1">
<div class="de1">&lt;pre lang=&quot;shell&quot;&gt;
</div>
</li>
<li class="li1">
<div class="de1">scp [local_file] [remote_user]@[remote_host]:[path]</div>
</li>
</ol>
</div>
<p>Copy the local file &#8220;readme.txt&#8221; on your remote host folder (don&#8217;t forget the &#8220;~&#8221;) using the &#8220;john&#8221; username. Let&#8217;s suppose the remote host is called &#8220;wonderland.org&#8221;.</p>
<div class="geshi no shell">
<ol>
<li class="li1">
<div class="de1">scp readme.txt john@wonderland.org:~</div>
</li>
</ol>
</div>
<p>Copying file from host:</p>
<div class="geshi no shell">
<ol>
<li class="li1">
<div class="de1">scp scp [remote_user]@[remote_host]:[remote_file_path][local_file_path]</div>
</li>
</ol>
</div>
<div class="flockcredit" style="text-align: right; color: #ccc; font-size: x-small;">Blogged with the <a style="color: #999; font-weight: bold;" title="Flock Browser" href="http://www.flock.com/blogged-with-flock" target="_new">Flock Browser</a></div>
]]></content:encoded>
			<wfw:commentRss>http://www.danidemi.com/mainwww/2010/02/ssh-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
