{"id":184,"date":"2005-12-07T17:05:00","date_gmt":"2005-12-07T17:05:00","guid":{"rendered":"http:\/\/www.bartbusschots.ie\/blog\/?p=184"},"modified":"2014-08-04T17:25:19","modified_gmt":"2014-08-04T17:25:19","slug":"ssh-via-a-socks-proxy-on-os-x-with-connectc","status":"publish","type":"post","link":"https:\/\/www.bartbusschots.ie\/s\/2005\/12\/07\/ssh-via-a-socks-proxy-on-os-x-with-connectc\/","title":{"rendered":"SSH via a Socks proxy on OS X with connect.c"},"content":{"rendered":"<p style=\"font-style:italic;color:red\"><strong>NOTE:<\/strong> tested on OS X 10.7 Lion, works fine!<\/p>\n<p>These instructions are for setting up a mac to use <code><a title=\"connect.c SSH Proxy Command\" href=\"http:\/\/zippo.taiyo.co.jp\/~gotoh\/ssh\/connect.html\">connect.c<\/a><\/code> to get SSH through a SOCKS proxy. If you are not using OS X this may still be of some use to you because <code>connect.c<\/code> will compile on Windows and *nix as well. If you&#8217;re in the NUIM oncampus accommodation and are having problems SSHing this could be the answer to your problems!<\/p>\n<p>The first step is to <a title=\"get connect.c\" href=\"http:\/\/www.meadowy.org\/~gotoh\/ssh\/connect.c\">get a copy of <code>connect.c<\/code><\/a> and compile it. The website contains instructions for doing this on other platforms but for the mac use:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\ngcc connect.c -o connect -lresolv\r\n<\/pre>\n<p>This will spool out a ream of warnings but don&#8217;t worry about that.<\/p>\n<p>Then you have to copy this to a folder in the path and set up the correct permissions:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nsudo cp connect \/usr\/bin\r\nsudo chmod 555 \/usr\/bin\/connect\r\nsudo chown root:wheel \/usr\/bin\/connect\r\n<\/pre>\n<p>At this stage <code>connect.c<\/code> is installed, you now need to tell SSH to use this proxy for any servers you want to connect to that is outside the campus.<\/p>\n<p>To do this you need to add lines of this form to <code>~\/.ssh\/config<\/code>:<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nHost xxx.yyy.com\r\n  ProxyCommand connect -a none -S socks.yyy.com %h %p\r\n<\/pre>\n<p>The example above is for connection to xxx.yyy.com, you&#8217;ll need pairs like this for each host you want to connect to. You should separate the pairs with a bank line.<\/p>\n<p>That&#8217;s it, you can now ssh as normal and ssh will use the SOCKS proxy.<\/p>\n<pre class=\"brush: plain; title: ; notranslate\" title=\"\">\r\nssh user@xxx.yyy.com\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>NOTE: tested on OS X 10.7 Lion, works fine! These instructions are for setting up a mac to use connect.c to get SSH through a SOCKS proxy. If you are not using OS X this may still be of some use to you because connect.c will compile on Windows and *nix as well. If you&#8217;re [&hellip;]<\/p>\n","protected":false},"author":3,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","default_image_id":0,"font":"","enabled":false},"version":2},"jetpack_post_was_ever_published":false},"categories":[12,446],"tags":[466,391,139,188,458],"series":[],"class_list":["post-184","post","type-post","status-publish","format-standard","hentry","category-computers-tech","category-sysadmin","tag-openssh","tag-proxies","tag-review","tag-software","tag-tutorial"],"jetpack_publicize_connections":[],"jetpack_featured_media_url":"","jetpack_shortlink":"https:\/\/wp.me\/p7t9xK-2Y","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/184","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/comments?post=184"}],"version-history":[{"count":5,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/184\/revisions"}],"predecessor-version":[{"id":7549,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/posts\/184\/revisions\/7549"}],"wp:attachment":[{"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/media?parent=184"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/categories?post=184"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/tags?post=184"},{"taxonomy":"series","embeddable":true,"href":"https:\/\/www.bartbusschots.ie\/s\/wp-json\/wp\/v2\/series?post=184"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}