Advertisement
metalx1000

SSH Proxy Tunneling with Tsocks

Apr 10th, 2020
1,378
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.77 KB | None | 0 0
  1. ###force proxy on programs
  2. ##  NOTE  -  We are using port 8123,
  3. ##           but you can pick any port not being used
  4. ##           that you have permission to access
  5. #install tsocks
  6. sudo apt install tsocks
  7.  
  8. ##put the following in ~/.tsocks.conf
  9. server = 127.0.0.1
  10. server_port = 8123
  11. server_type = 5
  12. local = 127.0.0.0/255.255.255.0
  13.  
  14. #setup an SSH server to tunnel through (cloudssh is just one of many options)
  15. https://cloudssh.us/
  16.  
  17. #setup ssh proxy tunnel
  18. ssh -ND 8123 <USERNAME>@<IP-ADDRESS>
  19.  
  20. #check your real IP ADDRESS
  21. wget -qO- http://ipecho.net/plain
  22. #or
  23. curl http://ipecho.net/plain
  24.  
  25. #now through the proxy using tsocks
  26. tsocks wget -qO- http://ipecho.net/plain
  27. #or
  28. tsocks curl http://ipecho.net/plain
  29.  
  30. #if all went well, your IP should now show as the ssh server's ip
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement