<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>http://wiki.breedveld.net/index.php?action=history&amp;feed=atom&amp;title=SSH_Tunneling</id>
	<title>SSH Tunneling - Revision history</title>
	<link rel="self" type="application/atom+xml" href="http://wiki.breedveld.net/index.php?action=history&amp;feed=atom&amp;title=SSH_Tunneling"/>
	<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=SSH_Tunneling&amp;action=history"/>
	<updated>2026-04-17T00:36:56Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.44.2</generator>
	<entry>
		<id>http://wiki.breedveld.net/index.php?title=SSH_Tunneling&amp;diff=2103&amp;oldid=prev</id>
		<title>Roland: Protected &quot;SSH Tunneling&quot; [edit=autoconfirmed:move=autoconfirmed]</title>
		<link rel="alternate" type="text/html" href="http://wiki.breedveld.net/index.php?title=SSH_Tunneling&amp;diff=2103&amp;oldid=prev"/>
		<updated>2009-07-03T15:20:23Z</updated>

		<summary type="html">&lt;p&gt;Protected &amp;quot;&lt;a href=&quot;/index.php/SSH_Tunneling&quot; title=&quot;SSH Tunneling&quot;&gt;SSH Tunneling&lt;/a&gt;&amp;quot; [edit=autoconfirmed:move=autoconfirmed]&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;There are 2 types of ssh tunnels, Forward and Reverse:&lt;br /&gt;
&lt;br /&gt;
example for ssh tunneling on the ftp-port to your home server, for imap-mail, vnc and internet proxy:&lt;br /&gt;
&lt;br /&gt;
If you like, it is easier to distibute a public key, so you can automate these commands.&lt;br /&gt;
&lt;br /&gt;
while many company&amp;#039;s have limitted internet access for ssh, you will run a daemmon on a different free port.&lt;br /&gt;
e.g. 21 (ftp) 443 (htps) or 8080&lt;br /&gt;
&lt;br /&gt;
at home start a ssh daemon running on the ftp port 21&lt;br /&gt;
 /usr/sbin/sshd -p 21&lt;br /&gt;
you can add this in your /etc/rc.local&lt;br /&gt;
&lt;br /&gt;
from your client run:&lt;br /&gt;
 ssh -C -g -L6001:&amp;lt;vncserver&amp;gt;:5901&lt;br /&gt;
           -L6002:&amp;lt;mailserver&amp;gt;:143 \&lt;br /&gt;
           -L6003:&amp;lt;proxyserver&amp;gt;:3128 \&lt;br /&gt;
           -p 21 \&lt;br /&gt;
            user@&amp;lt;home-server&amp;gt;&lt;br /&gt;
Options:&lt;br /&gt;
 -C will compress the traffic (very handy for VNC connections)&lt;br /&gt;
 -g will access other pc&amp;#039;s at home to connect to the tunnel on your server&lt;br /&gt;
other options are:&lt;br /&gt;
 -n will not return your session to your prompt and redirect everything to /dev/null&lt;br /&gt;
 -X will forward a tunnel for X sessions&lt;br /&gt;
for more options see the ssh manpage&lt;br /&gt;
&lt;br /&gt;
it will be nice to create a dedicated user on your home-server.&lt;br /&gt;
On your client you should configure your imap-mail with port 6002, e.g.&lt;br /&gt;
&lt;br /&gt;
If you want to connect from the outside to an internal server which is not accessible from the outsite, you will setup a reverse tunnel:&lt;br /&gt;
you run this on a server which can connect both to (example) a vnc service on another server and to the internet.&lt;br /&gt;
 ssh -C -g -R6001:&amp;lt;vncserver&amp;gt;:5901 \&lt;br /&gt;
           -p 21 \&lt;br /&gt;
           user@&amp;lt;home-server&amp;gt;&lt;br /&gt;
At home you start a VNC sesion to your server:1 (5901), it will connect through the tunnel to the vnc-session of the server on the internal network.&lt;br /&gt;
&lt;br /&gt;
If the connection drops the tunnes is gone, so you write a little loop around it:&lt;br /&gt;
 #!/bin/bash&lt;br /&gt;
 while true&lt;br /&gt;
 do&lt;br /&gt;
   ssh -C -g -R6001:&amp;lt;vncserver&amp;gt;:5901 \&lt;br /&gt;
             -p 21 \&lt;br /&gt;
           user@&amp;lt;home-server&amp;gt;&lt;br /&gt;
   sleep 10&lt;br /&gt;
 done&lt;br /&gt;
In this situation you can remote force a reconnect by killing the incomming ssh session on your home-server:&lt;br /&gt;
 pkill -u &amp;lt;user&amp;gt;&lt;br /&gt;
in this case it is easier to create a dedicated ssh user on your home-server.&lt;br /&gt;
&lt;br /&gt;
For Gnome users the is a verry nice GUI called gSTM:&amp;lt;br&amp;gt;&lt;br /&gt;
[[Image:gstm.jpg]]&lt;/div&gt;</summary>
		<author><name>Roland</name></author>
	</entry>
</feed>