我正在尝试通过 SOCKS5 代理连接到服务器。我试过使用 -o 并编辑我的 ~/.ssh/config 文件但无济于事。
这是我尝试过的 SSH 命令:
ssh -v -o 'ProxyCommand=nc -X 5 -x proxyhost:1080 %h %p' -p22 username@serverhost
问题似乎是我的代理主机需要用户名和密码,我看不到如何在 ProxyCommand 中传递用户/密码。
最佳答案
您需要将用户名和密码传递给 nc
命令,他正在做您的代理。关于它的所有内容都写在 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.
关于macos - OSX SSH 通过 SOCKS5 代理服务器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34348720/