Forwarding ssh socks to outside users

Here’s the scheme. My fellow friend borrowed me a tunnel to his (sort of) expensive VPS and told me to create a socks using ssh with this command:

ssh -fND localhost:6666 account@his-vps.org

After setting the proxy (using sock not http) configuration on the browser with localhost port 6666, there you go, through his VPS I can open all the websites which are blocked by the office. However this rule is only useful for connecting from localhost.

Now, how about if other users want to use my socks? Here’s what I did:

ssh -fND my_computer_ip:2222 account@his-vps.org

sudo iptables -A INPUT -p tcp -m state –state NEW –dport 2222 -i eth1 -j ACCEPT

Different with the previous one you need to configure the browser proxy setting with my my_computer_ip port 2222 NOT localhost!! Btw, the second one means that any tcp connection coming to interface eth1 port 2222 of my computer should be accepted.

Acknowledge: Thanks for root@voidnetwork.org for the VPS

About Bondhan Novandy

Just simply ordinary person.
This entry was posted in Linux, Networking. Bookmark the permalink.

2 Responses to Forwarding ssh socks to outside users

  1. hari.utomo says:

    interesting article you have here bro,
    can i do it in windows.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>