{"id":328,"date":"2010-04-15T21:57:29","date_gmt":"2010-04-15T11:57:29","guid":{"rendered":"https:\/\/thedragon.kicks-ass.org\/blog\/?p=328"},"modified":"2010-11-05T14:09:19","modified_gmt":"2010-11-05T04:09:19","slug":"ssh-and-port-forwarding","status":"publish","type":"post","link":"https:\/\/thedragon.kicks-ass.org\/?p=328","title":{"rendered":"SSH and port forwarding"},"content":{"rendered":"<p>I seem to forget every time i use ssh for port forwarding which side goes where in the syntax, so to make it easy here it is.<\/p>\n<p>Forward a local port to a remote port at the far end, ie: tunnel a web server behind the firewall<\/p>\n<ul>\n<li>do the normal session in putty on the first page<\/li>\n<li>in the ssh-&gt;tunnels, source port is your local port, then &#8220;add&#8221; destination ip:port, leave as &#8220;local&#8221;<\/li>\n<\/ul>\n<p>Reverse Tunnel from the remote end, so you can ssh to a pc behind a firewall<\/p>\n<ul>\n<li>log into the box at the far end (eg: terminal server then putty)<\/li>\n<li>ssh -f -g -N -R 2210:localhost:22 thedragon.kicks-ass.org<\/li>\n<li>then you can ssh to 2210\u00c2\u00a0locally and it appears to be a ssh at the remote end<\/li>\n<\/ul>\n<p>May need to set ServerAliveInterval 30 and ServerAliveCountMax 1000 in the ssh_config<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I seem to forget every time i use ssh for port forwarding which side goes where in the syntax, so to make it easy here it is. Forward a local port to a remote port at the far end, ie: &hellip; <a href=\"https:\/\/thedragon.kicks-ass.org\/?p=328\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"spay_email":"","jetpack_publicize_message":"","jetpack_is_tweetstorm":false,"jetpack_publicize_feature_enabled":true},"categories":[9,4,7],"tags":[],"jetpack_featured_media_url":"","jetpack_publicize_connections":[],"jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p20dKL-5i","_links":{"self":[{"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=\/wp\/v2\/posts\/328"}],"collection":[{"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=328"}],"version-history":[{"count":11,"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=\/wp\/v2\/posts\/328\/revisions"}],"predecessor-version":[{"id":545,"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=\/wp\/v2\/posts\/328\/revisions\/545"}],"wp:attachment":[{"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=328"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=328"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/thedragon.kicks-ass.org\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=328"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}