{"id":28,"date":"2006-12-05T09:15:47","date_gmt":"2006-12-04T22:15:47","guid":{"rendered":"http:\/\/noraisin.net\/~jan\/diary\/?p=28"},"modified":"2006-12-05T09:15:47","modified_gmt":"2006-12-04T22:15:47","slug":"ssh-trick","status":"publish","type":"post","link":"https:\/\/noraisin.net\/diary\/?p=28","title":{"rendered":"SSH trick"},"content":{"rendered":"<p>A while ago, I wanted to copy some stuff from my laptop to a machine behind a proxying firewall. <\/p>\n<p>\nVery quickly, I got sick of copying something to the firewall, logging in, then copying to the final machine, so I put together a small ssh proxy script that would log into the firewall for me when I requested the dest machine (sunshine), and then use nc to connect to sunshine. <\/p>\n<p>\nBut, the problem is that sometimes I carry my laptop into the house where &#8216;sunshine&#8217; lives, so I extended it to become the script <a href=\"http:\/\/noraisin.net\/~jan\/code\/ssh-through-fw\">ssh-through-fw<\/a><\/p>\n<p>\nWith that script in an appropriate location, I add this to my ~\/.ssh\/config:<\/p>\n<p>\nhost sunshine<\/p>\n<p>\nProxyCommand $HOME\/.install\/bin\/ssh-through-fw 192.168.1. user@firewall %h %p<\/p>\n<p>\nWhere 192.168.1. is the prefix of the IP range used in the network behind the firewall.<\/p>\n<p>\nNow, when I am running remotely, connecting to sunshine happens through the firewall, but when I&#8217;m behind the firewall it connects directly to the machine without me thinking about it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A while ago, I wanted to copy some stuff from my laptop to a machine behind a proxying firewall. Very quickly, I got sick of copying something to the firewall, logging in, then copying to the final machine, so I put together a small ssh proxy script that would log into the firewall for me &hellip; <a href=\"https:\/\/noraisin.net\/diary\/?p=28\" class=\"more-link\">Continue reading<span class=\"screen-reader-text\"> &#8220;SSH trick&#8221;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-28","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/posts\/28","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=28"}],"version-history":[{"count":0,"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=\/wp\/v2\/posts\/28\/revisions"}],"wp:attachment":[{"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=28"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=28"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/noraisin.net\/diary\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=28"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}