<?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>Technical Diary &#187; ssh</title>
	<atom:link href="http://andriigrytsenko.net/tag/ssh/feed/" rel="self" type="application/rss+xml" />
	<link>http://andriigrytsenko.net</link>
	<description>With Andrii Grytsenko</description>
	<lastBuildDate>Tue, 17 Aug 2010 08:25:33 +0000</lastBuildDate>
	
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>SSH connection without password</title>
		<link>http://andriigrytsenko.net/2009/08/ssh-connection-without-password/</link>
		<comments>http://andriigrytsenko.net/2009/08/ssh-connection-without-password/#comments</comments>
		<pubDate>Fri, 14 Aug 2009 14:53:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Linux]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[unix]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=400</guid>
		<description><![CDATA[SSH password-less log in method.

Let&#8217;s imagine that we have 2 hosts.

 Host A with user1 is your local host from which you will connect to remote.
Host B with user2 is remote host where you want to log in as user2.

Run
ssh-keygen
 as user1 on Host A to generate keys unless old one is exist. When I [...]]]></description>
			<content:encoded><![CDATA[<p>SSH password-less log in method.<br />
<span id="more-400"></span></p>
<p>Let&#8217;s imagine that we have 2 hosts.</p>
<ul>
<li> Host A with user1 is your local host from which you will connect to remote.</li>
<li>Host B with user2 is remote host where you want to log in as user2.</li>
</ul>
<p>Run
<pre>ssh-keygen</pre>
<p> as user1 on Host A to generate keys unless old one is exist. When I will be prompted to enter  passphrase just keep it blank. This command generate RSA key with long in 2048 bit:</p>
<pre>ssh-keygen -b 2048
Generating public/private rsa key pair.
Enter file in which to save the key (/home/user1/.ssh/id_rsa):
/home/user1/.ssh/id_rsa already exists.
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in /home/user1/.ssh/id_rsa.
Your public key has been saved in /home/user1/.ssh/id_rsa.pub.
The key fingerprint is:
9e:f0:44:4a:e2:81:72:02:0b:3c:b5:3d:be:a7:c2:95 user1@host_a
The key's randomart image is:
+--[ RSA 2048]----+
...
+-----------------+
</pre>
<p>After it&#8217;s done check content of your <em>id_rsa.pub</em> file:</p>
<pre>host_a:~# cat .ssh/id_rsa.pub
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzU6SlO7EZksPGmLTz3EcMpFQXME9otJ4vWqQ1Nnzd0g0FX5MS
/H1m2xJWCLfgsWTWyOP7hHQufPrzY5kqJkeF0tgOSPHnzDQt4YBE1Xi0ihR/cDK+KHOlIFG4kHlEs/ThTDpD0mwgBC755Tu5g2GOW3ogsrViZbyfa72HJQaEbISZwfiPnJUwmtGJ/+PQiEoN8cgK1zrk8oVnlguK0V52ZygFuvNKd6jmKIiDKOcQ2ZIobu6jYVd/Nit1gg+9llbuAdXDFn24AdNHatBzvlwb76yYa/ZAwZQKzytWca0NnMMwMeQ== user1@host_a</pre>
<p>Copy it and log in remote Host B as user2. And append it to <em>authorized_keys</em> file:</p>
<pre>$ cat &gt;&gt; /home/grytsenko/.ssh/authorized_keys
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAzU6SlO7EZksPGmLTz3EcMpFQXME9otJ4vWqQ1Nnzd0g0FX5MS
/H1m2xJWCLfgsWTWyOP7hHQufPrzY5kqJkeF0tgOSPHnzDQt4YBE1Xi0ihR/cDK+KHOlIFG4kHlEs/ThTDpD0mwgBC755Tu5g2GOW3ogsrViZbyfa72HJQaEbISZwfiPnJUwmtGJ/+PQiEoN8cgK1zrk8oVnlguK0V52ZygFuvNKd6jmKIiDKOcQ2ZIobu6jYVd/Nit1gg+9llbuAdXDFn24AdNHatBzvlwb76yYa/ZAwZQKzytWca0NnMMwMeQ== user1@host_a</pre>
<p>Set proper permissions for file:</p>
<pre>user2@host_b:~$ chmod 600 ~/.ssh/authorized_keys</pre>
<p>Now you are ready to log in without password from Host A:</p>
<pre>host_a~# ssh -p 443 user2@host_b
Linux host_b 2.6.18-5-686 #1 SMP Fri Jun 1 00:47:00 UTC 2007 i686</pre>
<p>That&#8217;s all folks:).</p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2009/08/ssh-connection-without-password/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to get fully internet functionality from restricted environment over ssh</title>
		<link>http://andriigrytsenko.net/2009/07/how-to-get-fully-internet-functionality-from-restricted-environment-over-ssh/</link>
		<comments>http://andriigrytsenko.net/2009/07/how-to-get-fully-internet-functionality-from-restricted-environment-over-ssh/#comments</comments>
		<pubDate>Tue, 07 Jul 2009 22:44:12 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[*nix]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[ssh]]></category>
		<category><![CDATA[tunnels]]></category>

		<guid isPermaLink="false">http://andriigrytsenko.net/?p=229</guid>
		<description><![CDATA[If you working place don&#8217;t provide internet or provide very restricted access to web pages. But you want to feel free in the internet browsing.

For this you need:
1. At least one open port for output connection OR access to proxy.
2. Server in the internet with root OR user rights. 
You can easily get it in [...]]]></description>
			<content:encoded><![CDATA[<p>If you working place don&#8217;t provide internet or provide very restricted access to web pages. But you want to feel free in the internet browsing.<br />
<span id="more-229"></span></p>
<p>For this you need:<br />
1. At least one open port for output connection OR access to proxy.<br />
2. Server in the internet with root OR user rights. </p>
<p>You can easily get it in several simple steps. Just imagine that you located at office1 and open port for ongoing connection = 443. Also you have access to server1 which located at internet. Now go to server1 and edit ssh configuration file. Add new <em>port</em> directive into this file(in case if you have open port, in other case skip this step). Like this:</p>
<pre>server1# grep -i port /etc/ssh/sshd_config
Port 22
Port 443
</pre>
<p>As you can see now server1 use 2 ports(22 and 443) for ssh daemon. Let&#8217;s check it:</p>
<pre>server1# netstat -lnp | grep ssh
tcp        0      0 0.0.0.0:22              0.0.0.0:*               LISTEN      3946/sshd
tcp        0      0 0.0.0.0:443             0.0.0.0:*               LISTEN      3946/sshd
</pre>
<p>It&#8217;s ok. The next step #2 install proxy server. You can choose anyone you like. I chose tinyproxy, because of it&#8217;s very small and simple in configuration. </p>
<pre>server1# apt-get install tinyproxy </pre>
<p>It&#8217;s valid command for debian. For your distro use distro specific package manager as well. </p>
<p>Go to /etc/tinyproxy/tinyproxy.conf and check <em>port</em> and <em>listen</em> directives for determinate on which port and address your proxy listen. In my case it&#8217;s port 8888 on localhost: </p>
<pre>server1#grep -E "^(Port|Listen)"  /etc/tinyproxy/tinyproxy.conf
Port 8888
Listen 127.0.0.1</pre>
<p>Start daemon and check that it run: </p>
<pre>server1# /etc/init.d/tinyproxy start
server1# netstat -lnp | grep tinyproxy
tcp        0      127.0.0.1:8888              0.0.0.0:*               LISTEN      3923/tinyproxy</pre>
<p>Looks fine. Now make ssh tunnel to your server. If you have direct connection to server. Use this :</p>
<pre>server1#ssh -p 443 user@server#1 -L8888:127.0.0.01:8888 </pre>
<p>If not then do as described <a href="http://andriigrytsenko.net/2009/07/ssh-connection-via-http-proxy/">here</a>. </p>
<p>And last one step is setting up proxy 127.0.0.1:8888 on your browser and enjoy. </p>
]]></content:encoded>
			<wfw:commentRss>http://andriigrytsenko.net/2009/07/how-to-get-fully-internet-functionality-from-restricted-environment-over-ssh/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
