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.
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.