<?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>/kb &#187; ssh</title>
	<atom:link href="http://grx.no/kb/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://grx.no/kb</link>
	<description>personal knowledgebase</description>
	<lastBuildDate>Mon, 06 Feb 2012 17:05:03 +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>SSH aliases</title>
		<link>http://grx.no/kb/2010/06/18/ssh-aliases/</link>
		<comments>http://grx.no/kb/2010/06/18/ssh-aliases/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 08:02:56 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=198</guid>
		<description><![CDATA[In ~/.ssh/config add the following: Host ALIAS HostName DOMAIN User USERNAME Port PORT_NUMBER]]></description>
			<content:encoded><![CDATA[<p>In <code>~/.ssh/config</code> add the following:</p>

<div class="wp_syntax"><div class="code"><pre class="ssh" style="font-family:monospace;">Host ALIAS
HostName DOMAIN
User USERNAME
Port PORT_NUMBER</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2010/06/18/ssh-aliases/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Passwordless login with MacFusion</title>
		<link>http://grx.no/kb/2009/08/06/passwordless-login-with-macfusion/</link>
		<comments>http://grx.no/kb/2009/08/06/passwordless-login-with-macfusion/#comments</comments>
		<pubDate>Thu, 06 Aug 2009 07:28:22 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Server]]></category>
		<category><![CDATA[authentication]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[macfusion]]></category>
		<category><![CDATA[password]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=169</guid>
		<description><![CDATA[Put a reference to the private key file in ~/.ssh/config, for example: IdentityFile ~/.ssh/id_rsa Source: FAQS.org]]></description>
			<content:encoded><![CDATA[<p>Put a reference to the private key file in <code>~/.ssh/config</code>, for example:</p>
<pre>
IdentityFile ~/.ssh/id_rsa
</pre>
<p>Source: <a href="http://www.faqs.org/docs/securing/chap15sec121.html">FAQS.org</a></p>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2009/08/06/passwordless-login-with-macfusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Make SSHKeychain work in Leopard</title>
		<link>http://grx.no/kb/2009/06/22/make-sshkeychain-work-in-leopard/</link>
		<comments>http://grx.no/kb/2009/06/22/make-sshkeychain-work-in-leopard/#comments</comments>
		<pubDate>Mon, 22 Jun 2009 08:43:03 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Shell]]></category>
		<category><![CDATA[leopard]]></category>
		<category><![CDATA[mac]]></category>
		<category><![CDATA[mac os]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[sshkeychain]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=164</guid>
		<description><![CDATA[Here&#8217;s how I set up SSHKeychain on my Mac: Modify the package content as described Add stuff to .bashrc/.profile Add keys to SSHKeychain: Preferences > SSH Keys Check Manage (and modify) global environment variables (this probably has no effect, ref 2.)]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s how I set up <a href="http://www.sshkeychain.org/">SSHKeychain</a> on my Mac:</p>
<ol>
<li><a href="http://samj.net/2008/06/sshkeychain-082-post-install-problem-on.html">Modify the package content as described<br />
</a></li>
<li><a href="http://sportsdaft.blogspot.com/2008/04/getting-sshkeychain-to-work-on-leopard.html">Add stuff to .bashrc/.profile</a></li>
<li>Add keys to SSHKeychain: Preferences > SSH Keys</li>
<li>Check Manage (and modify) global environment variables (this probably has no effect, ref 2.)</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2009/06/22/make-sshkeychain-work-in-leopard/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Backing up my Macbook with rsync, SSH and Cron</title>
		<link>http://grx.no/kb/2008/09/13/backing-up-my-macbook-with-rsync-ssh-and-cron/</link>
		<comments>http://grx.no/kb/2008/09/13/backing-up-my-macbook-with-rsync-ssh-and-cron/#comments</comments>
		<pubDate>Sat, 13 Sep 2008 21:29:12 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[Server]]></category>
		<category><![CDATA[backup]]></category>
		<category><![CDATA[cron]]></category>
		<category><![CDATA[rsync]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://grx.no/kb/?p=70</guid>
		<description><![CDATA[I&#8217;ve created a simple script which syncs my documents folder with a remote computer. The files are transferred across the SSH protocol and the backup is performed daily with assistance of cron. My rsync script is very simple: #!/bin/bash rsync -avzr --delete-excluded --exclude=&#34;*.log&#34; --exclude=&#34;*.aux&#34; --exclude=&#34;.svn&#34; --exclude=&#34;.classpath&#34; --exclude=&#34;.cache&#34; --exclude=&#34;.project&#34; --exclude=&#34;*.class&#34; --exclude=&#34;*.swp&#34; --exclude=&#34;.DS_Store&#34; --exclude=&#34;.metadata&#34; -e &#34;ssh -c [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve created a simple script which syncs my documents folder with a remote computer. The files are transferred across the SSH protocol and the backup is performed daily with assistance of cron.</p>
<p>My rsync script is very simple:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
rsync <span style="color: #660033;">-avzr</span> <span style="color: #660033;">--delete-excluded</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;*.log&quot;</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;*.aux&quot;</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;.svn&quot;</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;.classpath&quot;</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;.cache&quot;</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;.project&quot;</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;*.class&quot;</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;*.swp&quot;</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;.DS_Store&quot;</span> <span style="color: #660033;">--exclude</span>=<span style="color: #ff0000;">&quot;.metadata&quot;</span> <span style="color: #660033;">-e</span> <span style="color: #ff0000;">&quot;ssh -c blowfish&quot;</span> <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>USERNAME<span style="color: #000000; font-weight: bold;">/</span>Documents USER<span style="color: #000000; font-weight: bold;">@</span>REMOTE_COMPUTER:REMOTE_DIRECTORY</pre></div></div>

<p>It was quite tricky to set up the cron job until i realized that cron does know very little of the user&#8217;s system. The trick was to add <code>SSH_AUTH_SOCK=/tmp/501/SSHKeychain.socket</code> in front of the script refrence in crontab, so that it looks like:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #000000;">55</span> <span style="color: #000000;">21</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #000000; font-weight: bold;">*</span> <span style="color: #007800;">SSH_AUTH_SOCK</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #000000;">501</span><span style="color: #000000; font-weight: bold;">/</span>SSHKeychain.socket <span style="color: #000000; font-weight: bold;">/</span>Users<span style="color: #000000; font-weight: bold;">/</span>USERNAME<span style="color: #000000; font-weight: bold;">/</span>etc<span style="color: #000000; font-weight: bold;">/</span>backup.sh</pre></div></div>

<p>This will cause the backup script to run at 21:55 each night. For more info on cron, check out <a href="http://www.unixgeeks.org/security/newbie/unix/cron-1.html">unixgeeks.org</a>. Add the following at the end if you&#8217;d like to suppress the mail from cron: <code> >&#038; /dev/null</code>.</p>
<p>Note that for this script to run, SSH has to be set up with <a href="http://www.petefreitag.com/item/532.cfm">keypairs authentication.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2008/09/13/backing-up-my-macbook-with-rsync-ssh-and-cron/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Simple scp script for copying to SSH enabled accounts</title>
		<link>http://grx.no/kb/2008/04/10/simple-scp-script/</link>
		<comments>http://grx.no/kb/2008/04/10/simple-scp-script/#comments</comments>
		<pubDate>Thu, 10 Apr 2008 07:37:37 +0000</pubDate>
		<dc:creator>hgrimelid</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[scp]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://k.grx.no/?p=5</guid>
		<description><![CDATA[I frequently use scp to copy files to shell accounts. It&#8217;s quite annoying to type the full account info each time, so by writing a very small and very simple shell script some typing can be saved: #!/bin/bash scp -r &#34;$1&#34; login@server.domain.com:$2 The script copies file $1 to the destination $2 on the server. With [...]]]></description>
			<content:encoded><![CDATA[<p>I frequently use scp to copy files to shell accounts. It&#8217;s quite annoying to type the full account info each time, so by writing a very small and very simple shell script some typing can be saved:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #660033;">-r</span> <span style="color: #ff0000;">&quot;$1&quot;</span> <span style="color: #c20cb9; font-weight: bold;">login</span><span style="color: #000000; font-weight: bold;">@</span>server.domain.com:<span style="color: #007800;">$2</span></pre></div></div>

<p>The script copies file <em>$1</em> to the destination <em>$2</em> on the server. With <em>-r</em> option directories are copied as well. The &#8220;&#8221; are for taking care of file/directory names with spaces in.</p>
]]></content:encoded>
			<wfw:commentRss>http://grx.no/kb/2008/04/10/simple-scp-script/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

