{"id":257,"date":"2007-04-23T18:49:40","date_gmt":"2007-04-23T15:49:40","guid":{"rendered":"http:\/\/www.void.gr\/kargig\/blog\/?p=257"},"modified":"2007-04-23T18:49:50","modified_gmt":"2007-04-23T15:49:50","slug":"socks5-over-ssh","status":"publish","type":"post","link":"https:\/\/www.void.gr\/kargig\/blog\/2007\/04\/23\/socks5-over-ssh\/","title":{"rendered":"socks5 over ssh"},"content":{"rendered":"<p><strong>Scenario<\/strong>: A client behind a firewall that allows ssh and http outgoing traffic but blocks everything else (eg. the wireless network of <a href=\"http:\/\/www.cs.uoi.gr\">cs.uoi.gr<\/a>). A non-firewalled server running sshd somewhere on planet earth.<\/p>\n<p><strong>How<\/strong>:<br \/>\na) download\/install <a href=\"http:\/\/www.inet.no\/dante\/\">dante<\/a> on the server.<br \/>\nb) edit \/etc\/socks\/sockd.conf<br \/>\n<code>internal: 127.0.0.1 port = SOCKS.LISTENING.PORT<br \/>\nexternal: REAL.SERVER.IP<br \/>\nclientmethod: none<br \/>\nmethod: none<br \/>\nclient pass {      from: 127.0.0.0\/8 port 1-65535 to: 0.0.0.0\/0    }<br \/>\npass {      from: 127.0.0.0\/8 to: 0.0.0.0\/0      protocol: tcp udp    }<br \/>\nuser.privileged: SOCKS-USER<br \/>\nuser.notprivileged: SOCKS-USER<br \/>\nuser.libwrap: SOCKS-USER<br \/>\n<\/code><\/p>\n<p>c) start dante<\/p>\n<p>d) from the client machine:<br \/>\n<code>ssh USERNAME@REAL.SERVER.IP -L:SOCKS.LISTENING.PORT:127.0.0.1:SOCKS.LISTENING.PORT<\/code><br \/>\n<a href=\"http:\/\/www.onlamp.com\/pub\/a\/onlamp\/excerpt\/ssh_11\/index3.html\">more on ssh port forwarding<\/a><\/p>\n<p>e) Use socks5 proxy:<br \/>\n<code>host 127.0.0.1<br \/>\nport SOCKS.LISTENING.PORT<br \/>\n<\/code><br \/>\nwith your favorite program.<\/p>\n<p>Notes:<br \/>\nREAL.SERVER.IP = I really hope I don&#8217;t need to explain this.<br \/>\nSOCKS.LISTENING.PORT = the port that the socks server will listen. Try a non-priviledged port like 33333.<br \/>\nSOCKS-USER = the username that the socks server will run under (on gentoo this is: sockd). Don&#8217;t use root. Just don&#8217;t.<\/p>\n<p>Tip: You don&#8217;t need to use the same listening port for the socks server and for the local redirection port. It&#8217;s just for ease of use.<\/p>\n<p><strong>Results<\/strong>: Internet access though socks5 proxy over an ssh (encrypted!) connection. The socks server is not accessible to the world since it only listens for connections on the local loopback interface of the server.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Scenario: A client behind a firewall that allows ssh and http outgoing traffic but blocks everything else (eg. the wireless network of cs.uoi.gr). A non-firewalled server running sshd somewhere on planet earth. How: a) download\/install dante on the server. b) edit \/etc\/socks\/sockd.conf internal: 127.0.0.1 port = SOCKS.LISTENING.PORT external: REAL.SERVER.IP clientmethod: none method: none client pass [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"ep_exclude_from_search":false,"footnotes":""},"categories":[6,3],"tags":[],"class_list":["post-257","post","type-post","status-publish","format-standard","hentry","category-encryption","category-linux"],"aioseo_notices":[],"views":32196,"_links":{"self":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/257","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/comments?post=257"}],"version-history":[{"count":0,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/posts\/257\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/media?parent=257"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/categories?post=257"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.void.gr\/kargig\/blog\/wp-json\/wp\/v2\/tags?post=257"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}