Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

OSX SSH to server through SOCKS5 proxy

I am trying to connect to a server through a SOCKS5 proxy. I've tried using -o and editing my ~/.ssh/config file but to no avail.

Here is the SSH command I've tried:

ssh -v -o 'ProxyCommand=nc -X 5 -x proxyhost:1080 %h %p' -p22 username@serverhost

The problem seems to be that my proxyhost requires a username and password and I cannot see how to pass the user/pass in the ProxyCommand.

like image 503
davetropeano Avatar asked Apr 18 '26 13:04

davetropeano


1 Answers

You need to pass the username and password to nc command, who is doing your proxy. All about it is written in manual page for ncat(1):

--proxy-auth user[:pass] (Specify proxy credentials) .

In connect mode, gives the credentials that will be used to connect to the proxy server. In listen mode, gives the credentials that will be required of connecting clients. For use with --proxy-type http, the form should be user:pass. For --proxy-type socks4, it should be a username only.

like image 78
Jakuje Avatar answered Apr 21 '26 03:04

Jakuje



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!