<?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>deluxe-stylez.de &#187; ssh</title>
	<atom:link href="http://www.deluxe-stylez.de/tag/ssh/feed" rel="self" type="application/rss+xml" />
	<link>http://www.deluxe-stylez.de</link>
	<description>:: unix - brain required</description>
	<lastBuildDate>Fri, 20 Jan 2012 19:11:54 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>SSH Key &#8211; Public Key Authentication</title>
		<link>http://www.deluxe-stylez.de/2010/01/26/ssh-key-public-key-authentication</link>
		<comments>http://www.deluxe-stylez.de/2010/01/26/ssh-key-public-key-authentication#comments</comments>
		<pubDate>Tue, 26 Jan 2010 11:17:00 +0000</pubDate>
		<dc:creator>BeNe</dc:creator>
				<category><![CDATA[Scripts]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://www.deluxe-stylez.de/?p=446</guid>
		<description><![CDATA[Ich habe das alte Script auf der Seite durch dieses ersetzt. Was macht das Script genau ? Es kopiert den SSH-Key auf ein anderes System um einen SSH-Login ohne Passworteingabe zu ermöglichen. Ist oft für Script wie Nagios, Backups usw. nötig. ?View Code BASH1 2 3 4 5 6 7 8 9 10 11 12 [...]]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Ich habe das alte Script auf der Seite durch dieses ersetzt. Was macht das Script genau ?<br />
Es kopiert den SSH-Key auf ein anderes System um einen SSH-Login ohne Passworteingabe zu ermöglichen. Ist oft für Script wie Nagios, Backups usw. nötig.</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?" onclick="pageTracker._trackPageview('/outgoing/www.ericbess.com/ericblog/2008/03/03/wp-codebox/_examples?referer=');"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p446code2'); return false;">View Code</a> BASH</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p4462"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
</pre></td><td class="code" id="p446code2"><pre class="bash" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/bin/bash</span>
<span style="color: #666666; font-style: italic;"># kumar.mcmillan -at- farmdev.com</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> usage<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Authorizes a host for automatic SSH use by sending your key to the remote host ...&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;Usage: $0 remote_host_to_authorize [username:=defaults to current username]&quot;</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;&quot;</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> cleanup<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$TEMP_PUB_KEY_XFER</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #c20cb9; font-weight: bold;">rm</span> <span style="color: #007800;">$TEMP_PUB_KEY_XFER</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">function</span> exit_on_error<span style="color: #7a0874; font-weight: bold;">&#40;</span><span style="color: #7a0874; font-weight: bold;">&#41;</span>
<span style="color: #7a0874; font-weight: bold;">&#123;</span>
cleanup
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">1</span>
<span style="color: #7a0874; font-weight: bold;">&#125;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-lt</span> <span style="color: #000000;">1</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;$1&quot;</span> = <span style="color: #ff0000;">&quot;-h&quot;</span> <span style="color: #660033;">-o</span> <span style="color: #ff0000;">&quot;$1&quot;</span> = <span style="color: #ff0000;">&quot;--help&quot;</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>
<span style="color: #000000; font-weight: bold;">then</span>
usage
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span>
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #007800;">PUB_KEY</span>=~<span style="color: #000000; font-weight: bold;">/</span>.ssh<span style="color: #000000; font-weight: bold;">/</span>id_dsa.pub
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$#</span> <span style="color: #660033;">-eq</span> <span style="color: #000000;">2</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #007800;">USER</span>=<span style="color: #007800;">$2</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #007800;">USER</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">whoami</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #007800;">HOST_TO_AUTH</span>=<span style="color: #007800;">$1</span>
<span style="color: #007800;">TEMP_PUB_KEY_XFER</span>=<span style="color: #000000; font-weight: bold;">/</span>tmp<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$USER</span><span style="color: #ff0000;">&quot;_TEMP_KEY&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;checking for <span style="color: #007800;">$PUB_KEY</span> ...&quot;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #000000; font-weight: bold;">!</span> <span style="color: #660033;">-f</span> <span style="color: #007800;">$PUB_KEY</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;generating your dsa public key (leave passphrase blank and save to <span style="color: #007800;">$PUB_KEY</span> when prompted) ...&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> <span style="color: #660033;">-t</span> dsa
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;ssh-keygen failed&quot;</span>
exit_on_error
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;for the following commands you will be asked to supply your password for <span style="color: #007800;">$HOST_TO_AUTH</span> :&quot;</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;copying a temp pub key to <span style="color: #007800;">$HOST_TO_AUTH</span> ...&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">cat</span> <span style="color: #007800;">$PUB_KEY</span> <span style="color: #000000; font-weight: bold;">&amp;</span>gt; <span style="color: #007800;">$TEMP_PUB_KEY_XFER</span>
<span style="color: #c20cb9; font-weight: bold;">chmod</span> <span style="color: #000000;">700</span> <span style="color: #007800;">$TEMP_PUB_KEY_XFER</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK&quot;</span>
&nbsp;
<span style="color: #007800;">remote_key</span>=<span style="color: #000000; font-weight: bold;">`</span><span style="color: #c20cb9; font-weight: bold;">basename</span> <span style="color: #007800;">$TEMP_PUB_KEY_XFER</span><span style="color: #000000; font-weight: bold;">`</span>
<span style="color: #c20cb9; font-weight: bold;">scp</span> <span style="color: #007800;">$TEMP_PUB_KEY_XFER</span> <span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">@</span><span style="color: #007800;">$HOST_TO_AUTH</span>:~<span style="color: #000000; font-weight: bold;">/</span><span style="color: #007800;">$remote_key</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;scp failed&quot;</span>
exit_on_error
<span style="color: #000000; font-weight: bold;">fi</span>
&nbsp;
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;authorizing <span style="color: #007800;">$HOST_TO_AUTH</span> for automatic SSH use ...&quot;</span>
<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$USER</span><span style="color: #000000; font-weight: bold;">@</span><span style="color: #007800;">$HOST_TO_AUTH</span> <span style="color: #ff0000;">&quot;cat ~/<span style="color: #007800;">$remote_key</span> &amp;gt;&amp;gt; ~/.ssh/authorized_keys; rm ~/<span style="color: #007800;">$remote_key</span>&quot;</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">&#91;</span> <span style="color: #007800;">$?</span> <span style="color: #660033;">-ne</span> <span style="color: #000000;">0</span> <span style="color: #7a0874; font-weight: bold;">&#93;</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;ssh failed&quot;</span>
exit_on_error
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;OK&quot;</span>
&nbsp;
cleanup
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">&quot;authorization successful!  you can now login automatically to <span style="color: #007800;">$HOST_TO_AUTH</span>&quot;</span>
<span style="color: #7a0874; font-weight: bold;">exit</span> <span style="color: #000000;">0</span></pre></td></tr></table></div>

<div class="shr-publisher-446"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.deluxe-stylez.de/2010/01/26/ssh-key-public-key-authentication/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>SSH Public Key</title>
		<link>http://www.deluxe-stylez.de/2008/12/02/ssh-public-key</link>
		<comments>http://www.deluxe-stylez.de/2008/12/02/ssh-public-key#comments</comments>
		<pubDate>Tue, 02 Dec 2008 20:12:50 +0000</pubDate>
		<dc:creator>BeNe</dc:creator>
				<category><![CDATA[Linux & Co.]]></category>
		<category><![CDATA[Scripts]]></category>
		<category><![CDATA[key]]></category>
		<category><![CDATA[public]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>Hier ein kleines Script welches hilft den SSH Public Key auf andere Maschinen zu &#252;bertragen</p>
<hr />
<p>&#160;</p>
<pre class="bash"><span style="color: rgb(128, 128, 128); font-style: italic;">#!/bin/sh</span>
&#160;
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span> This script will <span style="color: rgb(122, 8, 116); font-weight: bold;">help</span> you setup <span style="color: rgb(194, 12, 185); font-weight: bold;">ssh</span> public key authentication.
&#160;
<span style="color: rgb(0, 120, 0);">host=</span>dummy
&#160;
<span style="color: rgb(0, 0, 0); font-weight: bold;">while</span> <span style="color: rgb(122, 8, 116); font-weight: bold;">[</span> -n <span style="color: rgb(255, 0, 0);">&#34;$host&#34;</span> <span style="color: rgb(122, 8, 116); font-weight: bold;">]</span>; <span style="color: rgb(0, 0, 0); font-weight: bold;">do</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span> -n <span style="color: rgb(255, 0, 0);">&#34;SSH server: &#34;</span>
<span style="color: rgb(194, 12, 185); font-weight: bold;">read</span> host
<span style="color: rgb(0, 0, 0); font-weight: bold;">if</span> <span style="color: rgb(122, 8, 116); font-weight: bold;">[</span> -n <span style="color: rgb(255, 0, 0);">&#34;$host&#34;</span> <span style="color: rgb(122, 8, 116); font-weight: bold;">]</span>; <span style="color: rgb(0, 0, 0); font-weight: bold;">then</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span> -n <span style="color: rgb(255, 0, 0);">&#34;user[$USER]: &#34;</span>
<span style="color: rgb(194, 12, 185); font-weight: bold;">read</span> usr
<span style="color: rgb(0, 0, 0); font-weight: bold;">if</span> <span style="color: rgb(122, 8, 116); font-weight: bold;">[</span> -z <span style="color: rgb(255, 0, 0);">&#34;$usr&#34;</span> <span style="color: rgb(122, 8, 116); font-weight: bold;">]</span>; <span style="color: rgb(0, 0, 0); font-weight: bold;">then</span>
<span style="color: rgb(0, 120, 0);">usr=</span><span style="color: rgb(0, 120, 0);">$USER</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">fi</span>
&#160;
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span> <span style="color: rgb(255, 0, 0);">&#34;Setting up RSA authentication for ${usr}@${host}...&#34;</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">if</span> <span style="color: rgb(122, 8, 116); font-weight: bold;">[</span> -f ~/.<span style="color: rgb(194, 12, 185); font-weight: bold;">ssh</span>/id_rsa.pub <span style="color: rgb(122, 8, 116); font-weight: bold;">]</span>; <span style="color: rgb(0, 0, 0); font-weight: bold;">then</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span> <span style="color: rgb(255, 0, 0);">&#34;RSA public key OK.&#34;</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">else</span>
<span style="color: rgb(194, 12, 185); font-weight: bold;">ssh-keygen</span> -t rsa -f ~/.<span style="color: rgb(194, 12, 185); font-weight: bold;">ssh</span>/id_rsa -N <span style="color: rgb(255, 0, 0);">&#34;&#34;</span>
<span style="color: rgb(0, 0, 0); font-weight: bold;">fi</span>
<span style="color: rgb(194, 12, 185); font-weight: bold;">scp</span> -P22  ~/.<span style="color: rgb(194, 12, 185); font-weight: bold;">ssh</span>/id_rsa.pub <span style="color: rgb(0, 120, 0);">$<span style="color: rgb(122, 8, 116); font-weight: bold;">{</span>usr<span style="color: rgb(122, 8, 116); font-weight: bold;">}</span></span>@<span style="color: rgb(0, 120, 0);">$<span style="color: rgb(122, 8, 116); font-weight: bold;">{</span>host<span style="color: rgb(122, 8, 116); font-weight: bold;">}</span></span>:~/
<span style="color: rgb(194, 12, 185); font-weight: bold;">ssh</span> <span style="color: rgb(0, 120, 0);">$<span style="color: rgb(122, 8, 116); font-weight: bold;">{</span>usr<span style="color: rgb(122, 8, 116); font-weight: bold;">}</span></span>@<span style="color: rgb(0, 120, 0);">$<span style="color: rgb(122, 8, 116); font-weight: bold;">{</span>host<span style="color: rgb(122, 8, 116); font-weight: bold;">}</span></span> -p22 <span style="color: rgb(255, 0, 0);">&#34;if [ ! -d ~/.ssh ]; then mkdir ~/.ssh fi cat ~/id_rsa.pub &#62;&#62; ~/.ssh/authorized_keys chmod 0600 ~/.ssh/authorized_keys rm ~/id_rsa.pub&#34;</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span> <span style="color: rgb(255, 0, 0);">&#34;You should see the following message without being prompted for anything now...&#34;</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span>
<span style="color: rgb(194, 12, 185); font-weight: bold;">ssh</span> <span style="color: rgb(0, 120, 0);">$<span style="color: rgb(122, 8, 116); font-weight: bold;">{</span>usr<span style="color: rgb(122, 8, 116); font-weight: bold;">}</span></span>@<span style="color: rgb(0, 120, 0);">$<span style="color: rgb(122, 8, 116); font-weight: bold;">{</span>host<span style="color: rgb(122, 8, 116); font-weight: bold;">}</span></span> <span style="color: rgb(255, 0, 0);">&#34;echo !!! Congratulations, you are now logged in as ${usr}@${host} !!!&#34;</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span> <span style="color: rgb(255, 0, 0);">&#34;If you were prompted, public key authentication could not be configured...&#34;</span>
&#160;
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span> <span style="color: rgb(255, 0, 0);">&#34;Enter a blank servername when done.&#34;</span>
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span>
fi
<span style="color: rgb(0, 0, 0); font-weight: bold;">done</span>
&#160;
<span style="color: rgb(122, 8, 116); font-weight: bold;">echo</span> <span style="color: rgb(255, 0, 0);">&#34;End of configuration.&#34;</span></pre>
<p>&#160;</p>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><p>Hier ein kleines Script welches hilft den SSH Public Key auf andere Maschinen zu übertragen</p>
<hr />
<pre class="bash"><span style="color: #808080; font-style: italic;">#!/bin/sh</span>

<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> This script will <span style="color: #7a0874; font-weight: bold;">help</span> you setup <span style="color: #c20cb9; font-weight: bold;">ssh</span> public key authentication.

<span style="color: #007800;">host=</span>dummy

<span style="color: #000000; font-weight: bold;">while</span> <span style="color: #7a0874; font-weight: bold;">[</span> -n <span style="color: #ff0000;">"$host"</span> <span style="color: #7a0874; font-weight: bold;">]</span>; <span style="color: #000000; font-weight: bold;">do</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">"SSH server: "</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> host
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">[</span> -n <span style="color: #ff0000;">"$host"</span> <span style="color: #7a0874; font-weight: bold;">]</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> -n <span style="color: #ff0000;">"user[$USER]: "</span>
<span style="color: #c20cb9; font-weight: bold;">read</span> usr
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">[</span> -z <span style="color: #ff0000;">"$usr"</span> <span style="color: #7a0874; font-weight: bold;">]</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #007800;">usr=</span><span style="color: #007800;">$USER</span>
<span style="color: #000000; font-weight: bold;">fi</span>

<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Setting up RSA authentication for ${usr}@${host}..."</span>
<span style="color: #000000; font-weight: bold;">if</span> <span style="color: #7a0874; font-weight: bold;">[</span> -f ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span>/id_rsa.pub <span style="color: #7a0874; font-weight: bold;">]</span>; <span style="color: #000000; font-weight: bold;">then</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"RSA public key OK."</span>
<span style="color: #000000; font-weight: bold;">else</span>
<span style="color: #c20cb9; font-weight: bold;">ssh-keygen</span> -t rsa -f ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span>/id_rsa -N <span style="color: #ff0000;">""</span>
<span style="color: #000000; font-weight: bold;">fi</span>
<span style="color: #c20cb9; font-weight: bold;">scp</span> -P22  ~/.<span style="color: #c20cb9; font-weight: bold;">ssh</span>/id_rsa.pub <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>usr<span style="color: #7a0874; font-weight: bold;">}</span></span>@<span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>host<span style="color: #7a0874; font-weight: bold;">}</span></span>:~/
<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>usr<span style="color: #7a0874; font-weight: bold;">}</span></span>@<span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>host<span style="color: #7a0874; font-weight: bold;">}</span></span> -p22 <span style="color: #ff0000;">"if [ ! -d ~/.ssh ]; then mkdir ~/.ssh fi cat ~/id_rsa.pub &gt;&gt; ~/.ssh/authorized_keys chmod 0600 ~/.ssh/authorized_keys rm ~/id_rsa.pub"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"You should see the following message without being prompted for anything now..."</span>
<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #c20cb9; font-weight: bold;">ssh</span> <span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>usr<span style="color: #7a0874; font-weight: bold;">}</span></span>@<span style="color: #007800;">$<span style="color: #7a0874; font-weight: bold;">{</span>host<span style="color: #7a0874; font-weight: bold;">}</span></span> <span style="color: #ff0000;">"echo !!! Congratulations, you are now logged in as ${usr}@${host} !!!"</span>
<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"If you were prompted, public key authentication could not be configured..."</span>

<span style="color: #7a0874; font-weight: bold;">echo</span>
<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"Enter a blank servername when done."</span>
<span style="color: #7a0874; font-weight: bold;">echo</span>
fi
<span style="color: #000000; font-weight: bold;">done</span>

<span style="color: #7a0874; font-weight: bold;">echo</span> <span style="color: #ff0000;">"End of configuration."</span></pre>
<div class="shr-publisher-33"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.deluxe-stylez.de/2008/12/02/ssh-public-key/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Feinste ascii art für den SSH-Banner</title>
		<link>http://www.deluxe-stylez.de/2008/12/02/feinste-ascii-art-fur-den-ssh-banner</link>
		<comments>http://www.deluxe-stylez.de/2008/12/02/feinste-ascii-art-fur-den-ssh-banner#comments</comments>
		<pubDate>Tue, 02 Dec 2008 20:08:49 +0000</pubDate>
		<dc:creator>BeNe</dc:creator>
				<category><![CDATA[Linux & Co.]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false"></guid>
		<description><![CDATA[<p>
<pre class="xml">
          .                                                      .
        .n                   .                 .                  n.
  .   .dP                  dP                   9b                 9b.    .
 4    qXb         .       dX                     Xb       .        dXp     t
dX.    9Xb      .dXb    __                         __    dXb.     dXP     .Xb
9XXb._       _.dXXXXb dXXXXbo.                 .odXXXXb dXXXXb._       _.dXXP
 9XXXXXXXXXXXXXXXXXXXVXXXXXXXXOo.           .oOXXXXXXXXVXXXXXXXXXXXXXXXXXXXP
  `9XXXXXXXXXXXXXXXXXXXXX'~   ~`OOO8b   d8OOO'~   ~`XXXXXXXXXXXXXXXXXXXXXP'
    `9XXXXXXXXXXXP' `9XX'          `98v8P'          `XXP' `9XXXXXXXXXXXP'
        ~~~~~~~       9X.          .db&#124;db.          .XP       ~~~~~~~
                        )b.  .dbo.dP'`v'`9b.odb.  .dX(
                      ,dXXXXXXXXXXXb     dXXXXXXXXXXXb.
                     dXXXXXXXXXXXP'   .   `9XXXXXXXXXXXb
                    dXXXXXXXXXXXXb   d&#124;b   dXXXXXXXXXXXXb
                    9XXb'   `XXXXXb.dX&#124;Xb.dXXXXX'   `dXXP
                     `'      9XXXXXX(   )XXXXXXP      `'
                              XXXX X.`v'.X XXXX
                              XP^X'`b   d'`X^XX
                              X. 9  `   '  P )X
                              `b  `       '  d'
&#160;
            ***************************************************
&#160;
                    This system is monitored by the sysop,
             any violation will be investigated and monitored.
&#160;
            ***************************************************
&#160;
&#160;
</pre>
</p>
<p>Auch wenn es niemand abschreckt, ist es immer wieder was nettes. BTW: Das CAPTCHA Module habe auch auf ASCII Art umgestellt womit die SPAM Bots sich noch etwas schwer tun. Das dieses Bild nie bei Google unter der &#34;Bilder Suche&#34; auftauchen wird ist wohl auch klar :D</p>]]></description>
			<content:encoded><![CDATA[<!-- Start Shareaholic LikeButtonSetTop Automatic --><!-- End Shareaholic LikeButtonSetTop Automatic --><pre class="xml">          .                                                      .
        .n                   .                 .                  n.
  .   .dP                  dP                   9b                 9b.    .
 4    qXb         .       dX                     Xb       .        dXp     t
dX.    9Xb      .dXb    __                         __    dXb.     dXP     .Xb
9XXb._       _.dXXXXb dXXXXbo.                 .odXXXXb dXXXXb._       _.dXXP
 9XXXXXXXXXXXXXXXXXXXVXXXXXXXXOo.           .oOXXXXXXXXVXXXXXXXXXXXXXXXXXXXP
  `9XXXXXXXXXXXXXXXXXXXXX'~   ~`OOO8b   d8OOO'~   ~`XXXXXXXXXXXXXXXXXXXXXP'
    `9XXXXXXXXXXXP' `9XX'          `98v8P'          `XXP' `9XXXXXXXXXXXP'
        ~~~~~~~       9X.          .db|db.          .XP       ~~~~~~~
                        )b.  .dbo.dP'`v'`9b.odb.  .dX(
                      ,dXXXXXXXXXXXb     dXXXXXXXXXXXb.
                     dXXXXXXXXXXXP'   .   `9XXXXXXXXXXXb
                    dXXXXXXXXXXXXb   d|b   dXXXXXXXXXXXXb
                    9XXb'   `XXXXXb.dX|Xb.dXXXXX'   `dXXP
                     `'      9XXXXXX(   )XXXXXXP      `'
                              XXXX X.`v'.X XXXX
                              XP^X'`b   d'`X^XX
                              X. 9  `   '  P )X
                              `b  `       '  d'

            ***************************************************

                    This system is monitored by the sysop,
             any violation will be investigated and monitored.

            ***************************************************</pre>
<p>Auch wenn es niemand abschreckt, ist es immer wieder was nettes. BTW: Das CAPTCHA Module habe auch auf ASCII Art umgestellt womit die SPAM Bots sich noch etwas schwer tun. Das dieses Bild nie bei Google unter der "Bilder Suche" auftauchen wird ist wohl auch klar <img src='http://www.deluxe-stylez.de/wp-includes/images/smilies/icon_biggrin.gif' alt=':D' class='wp-smiley' /> </p>
<div class="shr-publisher-32"></div><!-- Start Shareaholic LikeButtonSetBottom Automatic --><!-- End Shareaholic LikeButtonSetBottom Automatic -->]]></content:encoded>
			<wfw:commentRss>http://www.deluxe-stylez.de/2008/12/02/feinste-ascii-art-fur-den-ssh-banner/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

