<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
	
	>
<channel>
	<title>
	Comments on: Creating a Permanent SSH Tunnel Between Linux Servers	</title>
	<atom:link href="https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/feed" rel="self" type="application/rss+xml" />
	<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers</link>
	<description>Web Programming, Linux System Administation, and Entrepreneurship in Athens Georgia</description>
	<lastBuildDate>Fri, 12 Jul 2019 17:04:46 +0000</lastBuildDate>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.1</generator>
	<item>
		<title>
		By: Creating a Permanent SSH Tunnel from Linux &#124; Tinkerings		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-82807</link>

		<dc:creator><![CDATA[Creating a Permanent SSH Tunnel from Linux &#124; Tinkerings]]></dc:creator>
		<pubDate>Fri, 12 Jul 2019 17:04:46 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-82807</guid>

					<description><![CDATA[[&#8230;] following script is heavily based on this article by Brandon Checketts (the general script structure and the auth setup required for this to work) and this Stack Exchange [&#8230;]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] following script is heavily based on this article by Brandon Checketts (the general script structure and the auth setup required for this to work) and this Stack Exchange [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Simon		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-2856</link>

		<dc:creator><![CDATA[Simon]]></dc:creator>
		<pubDate>Tue, 13 Mar 2012 20:06:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-2856</guid>

					<description><![CDATA[I&#039;ve modified this a bit for my usage and though some of you might find the info useful. I have a server at work with a static ip behind a firewall that I can&#039;t change. I use that server to connect to another server (ssh port is only open to the work servers ip address) I can rdp into a machine on the same network and use putty to access the server.

So what I need is a tunnel to my machine at home (I use a Dynamic DNS to ensure that my home network is accessible from anywhere) now at home I can ssh -p 2222 localhost and get into the server at work.

Here&#039;s my setup for you:

createTunnel() {
    /usr/bin/ssh -f -N -R 2222:localhost:22 tunnel@[myhomenetworkname]
    if [[ $? -eq 0 ]]; then
        echo Tunnel to [myhomenetworkname] created successfully
    else
        echo An error occurred creating a tunnel to [myhomenetworkname] RC was $?
    fi
}
## check to see if the tunnel is running.  If it returns non-zero, then create a new connection
ps x &#124; grep &quot;2222\:localhost\:22&quot;
if [[ $? -ne 0 ]]; then
    echo Creating new tunnel connection
    createTunnel
fi

All the rest of the instructions are the same.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve modified this a bit for my usage and though some of you might find the info useful. I have a server at work with a static ip behind a firewall that I can&#8217;t change. I use that server to connect to another server (ssh port is only open to the work servers ip address) I can rdp into a machine on the same network and use putty to access the server.</p>
<p>So what I need is a tunnel to my machine at home (I use a Dynamic DNS to ensure that my home network is accessible from anywhere) now at home I can ssh -p 2222 localhost and get into the server at work.</p>
<p>Here&#8217;s my setup for you:</p>
<p>createTunnel() {<br />
    /usr/bin/ssh -f -N -R 2222:localhost:22 tunnel@[myhomenetworkname]<br />
    if [[ $? -eq 0 ]]; then<br />
        echo Tunnel to [myhomenetworkname] created successfully<br />
    else<br />
        echo An error occurred creating a tunnel to [myhomenetworkname] RC was $?<br />
    fi<br />
}<br />
## check to see if the tunnel is running.  If it returns non-zero, then create a new connection<br />
ps x | grep &#8220;2222\:localhost\:22&#8221;<br />
if [[ $? -ne 0 ]]; then<br />
    echo Creating new tunnel connection<br />
    createTunnel<br />
fi</p>
<p>All the rest of the instructions are the same.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: chris		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-2850</link>

		<dc:creator><![CDATA[chris]]></dc:creator>
		<pubDate>Wed, 22 Feb 2012 16:11:02 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-2850</guid>

					<description><![CDATA[FYI...If you are setting up a tunnel to allow other users to access you need to include the -g option]]></description>
			<content:encoded><![CDATA[<p>FYI&#8230;If you are setting up a tunnel to allow other users to access you need to include the -g option</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: uday		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-2846</link>

		<dc:creator><![CDATA[uday]]></dc:creator>
		<pubDate>Mon, 13 Feb 2012 08:35:30 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-2846</guid>

					<description><![CDATA[it is working perfect ... Thanks a lot .. it saved a lot of time ....]]></description>
			<content:encoded><![CDATA[<p>it is working perfect &#8230; Thanks a lot .. it saved a lot of time &#8230;.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: dave		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-1856</link>

		<dc:creator><![CDATA[dave]]></dc:creator>
		<pubDate>Fri, 25 Feb 2011 02:19:32 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-1856</guid>

					<description><![CDATA[I&#039;m running this on a router. It forwards ports 139 and 445 from a remote samba server. Local windows clients can now access remote network shares by pointing at the router.

Had some problems with the original and the check-script posted by John on 15 Jan 2010. Got a fix that worked, though:
Replaced:

nc -w1 localhost $tunnel_entrance_port
with:
lsof -i :$tunnel_entrance_port

The first passed an error every time, so the original script always tried to re-create the tunnel(s). lsof -i checks for a process listening to a particular port. I figured that if the port is already open, ssh won&#039;t be able to create the tunnel anyway.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m running this on a router. It forwards ports 139 and 445 from a remote samba server. Local windows clients can now access remote network shares by pointing at the router.</p>
<p>Had some problems with the original and the check-script posted by John on 15 Jan 2010. Got a fix that worked, though:<br />
Replaced:</p>
<p>nc -w1 localhost $tunnel_entrance_port<br />
with:<br />
lsof -i :$tunnel_entrance_port</p>
<p>The first passed an error every time, so the original script always tried to re-create the tunnel(s). lsof -i checks for a process listening to a particular port. I figured that if the port is already open, ssh won&#8217;t be able to create the tunnel anyway.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Life-Blog &#187; Bouw een redundant mysql systeem &#8211; deel 1		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-1783</link>

		<dc:creator><![CDATA[Life-Blog &#187; Bouw een redundant mysql systeem &#8211; deel 1]]></dc:creator>
		<pubDate>Tue, 24 Aug 2010 20:06:53 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-1783</guid>

					<description><![CDATA[[...] reading: - https://www.howtoforge.com/mysql_master_master_replication - https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers [...]]]></description>
			<content:encoded><![CDATA[<p>[&#8230;] reading: &#8211; <a href="https://www.howtoforge.com/mysql_master_master_replication" rel="nofollow ugc">https://www.howtoforge.com/mysql_master_master_replication</a> &#8211; <a href="https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers" rel="ugc">https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers</a> [&#8230;]</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Kurt Kraut		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-1768</link>

		<dc:creator><![CDATA[Kurt Kraut]]></dc:creator>
		<pubDate>Thu, 03 Jun 2010 16:13:37 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-1768</guid>

					<description><![CDATA[SSH can do the job, but OpenVPN is really the best option for a permanent tunnel. It is more resilient than autossh.]]></description>
			<content:encoded><![CDATA[<p>SSH can do the job, but OpenVPN is really the best option for a permanent tunnel. It is more resilient than autossh.</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: Sidailurch		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-1758</link>

		<dc:creator><![CDATA[Sidailurch]]></dc:creator>
		<pubDate>Thu, 06 May 2010 04:20:22 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-1758</guid>

					<description><![CDATA[kat - don&#039;t know if you&#039;re still looking, seeing as how i just stumbled upon this post - but i *think* what you&#039;re looking for is x11vnc - that should do what you want. Hope it helps]]></description>
			<content:encoded><![CDATA[<p>kat &#8211; don&#8217;t know if you&#8217;re still looking, seeing as how i just stumbled upon this post &#8211; but i *think* what you&#8217;re looking for is x11vnc &#8211; that should do what you want. Hope it helps</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: kat		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-1687</link>

		<dc:creator><![CDATA[kat]]></dc:creator>
		<pubDate>Thu, 21 Jan 2010 00:04:54 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-1687</guid>

					<description><![CDATA[I&#039;m still looking for help on related issue....This is scenario:

I&#039;m on my laptop, I want to run GUI that is on serverB.
I do not have direct access to serverB.  I do, however, have access to serverA and from there can get to Server B.

For comman line stuff...I use putty to get to ServerA, and ssh to ServerB.  How do I set up tunnel to be able to use VNCclient on my laptop to run vncserver on ServerB.

I know how to create putty tunnel to serverA in order to run vncserver on serverA.  But how to do it when I have to get to ServerB thru serverA.

Anyone?]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still looking for help on related issue&#8230;.This is scenario:</p>
<p>I&#8217;m on my laptop, I want to run GUI that is on serverB.<br />
I do not have direct access to serverB.  I do, however, have access to serverA and from there can get to Server B.</p>
<p>For comman line stuff&#8230;I use putty to get to ServerA, and ssh to ServerB.  How do I set up tunnel to be able to use VNCclient on my laptop to run vncserver on ServerB.</p>
<p>I know how to create putty tunnel to serverA in order to run vncserver on serverA.  But how to do it when I have to get to ServerB thru serverA.</p>
<p>Anyone?</p>
]]></content:encoded>
		
			</item>
		<item>
		<title>
		By: John		</title>
		<link>https://www.brandonchecketts.com/archives/creating-a-permanent-ssh-tunnel-between-linux-servers/comment-page-1#comment-1680</link>

		<dc:creator><![CDATA[John]]></dc:creator>
		<pubDate>Fri, 15 Jan 2010 20:39:58 +0000</pubDate>
		<guid isPermaLink="false">http://www.brandonchecketts.com/?p=186#comment-1680</guid>

					<description><![CDATA[I did some slight modification to the checking script, to get rid of the 2 port requirement, and to make it command line parameter driven.

#!/bin/bash

tunnel_entrance_port=$1
tunnel_end=$2
destination=$3
destination_port=$4


## use nc to connect to tunnel entrance port.  If it returns non-zero, then create a new connection
nc -w1 localhost $tunnel_entrance_port
if [[ $? -ne 0 ]]; then
    echo Creating new tunnel connection
    /usr/bin/ssh -f -N -L $tunnel_entrance_port:$destination:$destination_port $tunnel_end
    if [[ $? -eq 0 ]]; then
        echo Tunnel to $destination through $tunnel_end created successfully
    else
        echo An error occurred creating a tunnel to $destination through $tunnel_end was $?
    fi
fi]]></description>
			<content:encoded><![CDATA[<p>I did some slight modification to the checking script, to get rid of the 2 port requirement, and to make it command line parameter driven.</p>
<p>#!/bin/bash</p>
<p>tunnel_entrance_port=$1<br />
tunnel_end=$2<br />
destination=$3<br />
destination_port=$4</p>
<p>## use nc to connect to tunnel entrance port.  If it returns non-zero, then create a new connection<br />
nc -w1 localhost $tunnel_entrance_port<br />
if [[ $? -ne 0 ]]; then<br />
    echo Creating new tunnel connection<br />
    /usr/bin/ssh -f -N -L $tunnel_entrance_port:$destination:$destination_port $tunnel_end<br />
    if [[ $? -eq 0 ]]; then<br />
        echo Tunnel to $destination through $tunnel_end created successfully<br />
    else<br />
        echo An error occurred creating a tunnel to $destination through $tunnel_end was $?<br />
    fi<br />
fi</p>
]]></content:encoded>
		
			</item>
	</channel>
</rss>
