Use a server as SOCKS5 proxy over SSH

ssh -D 8080 -f -N srv1
Provides a SOCKS5 proxy on localhost port 8080 which will tunnel all connections through srv1 and run in the background.

0
2014-06-25 12:46:44

These Might Interest You

  • Routes curl input through a local SOCKS5 proxy; in this case, anonymizes curl activity via The Onion Router (Tor) proxy running locally. Note that the traffic will be anonymized, but it will NOT be encrypted, so your traffic will be very vulnerable to man-in-the-middle attacks. Show Sample Output


    1
    turl(){ curl --socks5-hostname localhost:9050 $@ ; }
    malathion · 2013-07-12 17:09:16 1
  • Tunneling an SSH session through TOR for anonymity. Using openbsd's netcat. Tested on Ubuntu 14.04 This also works with any proxy type: http, socks4 and socks5 For http proxy, replace -X 5 with -X connect For socks4 proxy, replace -X 5 with -X 4 (DNS leak may occur) Proxy host defined after -x Replace -x localhost:9050 with proxy server of your choice


    0
    ssh -o ProxyCommand="nc -X 5 -x localhost:9050 %h %p" username@remote_host
    unixmonkey77071 · 2014-06-09 08:54:58 0

  • -2
    /Applications/Google\ Chrome.app/Contents/MacOS/Google\ Chrome --proxy-server=socks5://HOST:PORT
    wr8cr8 · 2010-09-25 00:53:52 1
  • If you are behind a proxy server and have to authenticate with proxy server to browser web pages then you have to pass proxy server address and its port number along with user credentials to curl to got GET the page using curl. Example : "curl -U srikanth -x 167.85.103.70:8080


    2
    curl -U username[:password] -x proxyserverIP:proxyserverPort webpageURI
    SrikanthMujjiga · 2009-02-13 11:00:33 0

What do you think?

Any thoughts on this command? Does it work on your machine? Can you do the same thing with only 14 characters?

You must be signed in to comment.

What's this?

commandlinefu.com is the place to record those command-line gems that you return to again and again. That way others can gain from your CLI wisdom and you from theirs too. All commands can be commented on, discussed and voted up or down.

Share Your Commands



Stay in the loop…

Follow the Tweets.

Every new command is wrapped in a tweet and posted to Twitter. Following the stream is a great way of staying abreast of the latest commands. For the more discerning, there are Twitter accounts for commands that get a minimum of 3 and 10 votes - that way only the great commands get tweeted.

» http://twitter.com/commandlinefu
» http://twitter.com/commandlinefu3
» http://twitter.com/commandlinefu10

Subscribe to the feeds.

Use your favourite RSS aggregator to stay in touch with the latest commands. There are feeds mirroring the 3 Twitter streams as well as for virtually every other subset (users, tags, functions,…):

Subscribe to the feed for: