{"id":6036,"date":"2016-01-18T00:42:34","date_gmt":"2016-01-17T23:42:34","guid":{"rendered":"http:\/\/www.b.shuttle.de\/hayek\/hayek\/jochen\/wp\/blog-en\/?p=6036"},"modified":"2016-01-18T00:42:34","modified_gmt":"2016-01-17T23:42:34","slug":"ssh-to-beyond-the-corporate-firewall-through-a-socks-proxy-3","status":"publish","type":"post","link":"https:\/\/wp.jochen.hayek.name\/blog-en\/2016\/01\/18\/ssh-to-beyond-the-corporate-firewall-through-a-socks-proxy-3\/","title":{"rendered":"ssh to &#8220;beyond the corporate firewall&#8221; through a SOCKS proxy"},"content":{"rendered":"<ul>\n<li><a href=\"https:\/\/en.wikibooks.org\/wiki\/OpenSSH\/Cookbook\/Proxies_and_Jump_Hosts#Tunneling_SSH_Over_Tor_with_Netcat\">https:\/\/en.wikibooks.org\/wiki\/OpenSSH\/Cookbook\/Proxies_and_Jump_Hosts#Tunneling_SSH_Over_Tor_with_Netcat<\/a>\u00a0\u2013 this is THE ARTICLE &#8212; replace &#8220;Tor&#8221; in the example with your corporate SOCKS proxy<\/li>\n<li><a href=\"http:\/\/superuser.com\/questions\/454210\/how-can-i-use-ssh-with-a-socks-5-proxy\">http:\/\/superuser.com\/questions\/454210\/how-can-i-use-ssh-with-a-socks-5-proxy<\/a><\/li>\n<li><a href=\"http:\/\/linux.die.net\/man\/1\/nc\">http:\/\/linux.die.net\/man\/1\/nc<\/a>\u00a0&#8212; a netcat manual page<\/li>\n<\/ul>\n<p>My <code>$HOME\/.ssh\/config<\/code> looks like this:<\/p>\n<pre># making use of \"netcat\" AKA \"nc\" -- http:\/\/linux.die.net\/man\/1\/nc\n#\nHost SOME_HOST_OUT_THERE\n  User REMOTE_USER\n  ProxyCommand \/usr\/bin\/nc -X 5 -x SOCKS_PROXY_HOST:SOCKS_PROXY_PORT %h %p<\/pre>\n<p>&#8220;As always&#8221; I connect to SOME_HOST_OUT_THERE\u00a0like this:<\/p>\n<pre>$ ssh\u00a0REMOTE_USER@SOME_HOST_OUT_THERE\n# respectively\n$ ssh\u00a0SOME_HOST_OUT_THERE<\/pre>\n<p>You can also\u00a0&#8220;<em>rsync over ssh<\/em>&#8221; under these conditions \u2013 works like a charm.<\/p>\n<p>And: This also works in a Cygwin environment.<\/p>\n<p>PuTTY can use a SOCKS proxy just as well for connecting to a target &#8220;out there&#8221;:<\/p>\n<ul>\n<li><a href=\"https:\/\/en.wikipedia.org\/wiki\/PuTTY\">https:\/\/en.wikipedia.org\/wiki\/PuTTY<\/a><\/li>\n<li><a href=\"http:\/\/the.earth.li\/~sgtatham\/putty\/0.66\/htmldoc\/Chapter4.html#config-proxy\">http:\/\/the.earth.li\/~sgtatham\/putty\/0.66\/htmldoc\/Chapter4.html#config-proxy<\/a><\/li>\n<li><a href=\"http:\/\/tartarus.org\/~simon\/putty-snapshots\/htmldoc\/Chapter4.html#config-proxy\">http:\/\/tartarus.org\/~simon\/putty-snapshots\/htmldoc\/Chapter4.html#config-proxy<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/en.wikibooks.org\/wiki\/OpenSSH\/Cookbook\/Proxies_and_Jump_Hosts#Tunneling_SSH_Over_Tor_with_Netcat\u00a0\u2013 this is THE ARTICLE &#8212; replace &#8220;Tor&#8221; in the example with your corporate SOCKS proxy http:\/\/superuser.com\/questions\/454210\/how-can-i-use-ssh-with-a-socks-5-proxy http:\/\/linux.die.net\/man\/1\/nc\u00a0&#8212; a netcat manual page My $HOME\/.ssh\/config looks like this: # making use of &#8220;netcat&#8221; AKA &#8220;nc&#8221; &#8212; http:\/\/linux.die.net\/man\/1\/nc # Host SOME_HOST_OUT_THERE User REMOTE_USER ProxyCommand \/usr\/bin\/nc -X 5 -x SOCKS_PROXY_HOST:SOCKS_PROXY_PORT %h %p &#8220;As always&#8221; I connect to SOME_HOST_OUT_THERE\u00a0like [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","jetpack_post_was_ever_published":false,"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":true,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"_share_on_mastodon":"0"},"categories":[82,475],"tags":[1044,1179,1245,1309,1310],"class_list":["post-6036","post","type-post","status-publish","format-standard","hentry","category-cygwin","category-putty","tag-firewall","tag-netcat","tag-proxy","tag-socks","tag-socksify"],"share_on_mastodon":{"url":"","error":""},"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/paO0kP-1zm","jetpack_likes_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6036","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/comments?post=6036"}],"version-history":[{"count":0,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/posts\/6036\/revisions"}],"wp:attachment":[{"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/media?parent=6036"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/categories?post=6036"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wp.jochen.hayek.name\/blog-en\/wp-json\/wp\/v2\/tags?post=6036"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}