{"id":60,"date":"2009-10-08T15:51:20","date_gmt":"2009-10-08T05:51:20","guid":{"rendered":"http:\/\/vmadmin.nt.com.au\/?p=60"},"modified":"2011-04-06T10:25:23","modified_gmt":"2011-04-06T00:25:23","slug":"ssh-tunnel","status":"publish","type":"post","link":"https:\/\/vmadmin.nt.com.au\/?p=60","title":{"rendered":"SSH Tunnel"},"content":{"rendered":"<p>&nbsp;<\/p>\n<p>*Update. \u00a0You can do the following or you can make life easy and use www.teamviewer.com<\/p>\n<p>&nbsp;<\/p>\n<p>This is really for me to remember&#8230;..<br \/>\nWe all know how to do local tunnels with SSH but this is how to a remote tunnel to get around 2 firewalls.<\/p>\n<p>Example&#8230;.. A user on their mac, pc, whatever is behind their DSL router has SSH and Remote Desktop\/VNC available.<br \/>\nYou are at work or at your home behind a firewall.<br \/>\nYou have access to an intermediary SSH server available on the Internet for both parties to connect to.<\/p>\n<p>So, for example, a mac user would enable Remote desktop under Sharing and then open Terminal and type:<\/p>\n<p># ssh -R 57000:localhost:5900 user@sshserver.somewhere.com<\/p>\n<p>This breaks down thus:<\/p>\n<p>-R   means create a remote tunnel with a port listening on the remote SSH server<br \/>\n57000 is the random port I chose (over 1024) to use on the remote server. For this to work you have to add &#8220;GatewayPorts yes&#8221; to your sshd_config.<br \/>\nlocalhost:5900  =  the local port you want the remote user to connect on (VNC)<\/p>\n<p>Once that connection is made, on the other end of the connection, let&#8217;s say its a Windows box (with cygwin for ssh or Putty) you would run:<\/p>\n<p>ssh -L 57000:localhost:57000 user@sshserver.somewhere.com<\/p>\n<p>This breaks down thus:<\/p>\n<p>-L 57000:localhost:57000 means create a local tunnel from the remote port 57000 to local port 57000.<\/p>\n<p>Once this is connected, on the Windows box, open vncviewer and connect to localhost:57000 and you will connect to the Mac.<\/p>\n<p>Voila<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&nbsp; *Update. \u00a0You can do the following or you can make life easy and use www.teamviewer.com &nbsp; This is really for me to remember&#8230;.. We all know how to do local tunnels with SSH but this is how to a remote tunnel to get around 2 firewalls. Example&#8230;.. A user on their mac, pc, whatever [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[23,21,15,18,16,17,22],"class_list":["post-60","post","type-post","status-publish","format-standard","hentry","category-misc","tag-linux","tag-mac","tag-putty","tag-remote","tag-ssh","tag-tunnels","tag-windows"],"_links":{"self":[{"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=\/wp\/v2\/posts\/60","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=60"}],"version-history":[{"count":2,"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=\/wp\/v2\/posts\/60\/revisions"}],"predecessor-version":[{"id":67,"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=\/wp\/v2\/posts\/60\/revisions\/67"}],"wp:attachment":[{"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=60"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=60"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/vmadmin.nt.com.au\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=60"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}