Leif160519的blog Leif160519的blog

——————

目录
ssh通过http或者socks代理连接远程服务器
/    

ssh通过http或者socks代理连接远程服务器

直接上命令:

# http代理

ssh  -o ProxyCommand="nc -X connect -x 127.0.0.1:3128 %h %p" root@<server_ip>

# socks代理

ssh -o ProxyCommand="nc -X 5 -x 127.0.0.1:1080 %h %p" root@<server_ip>

说明:
nc命令的常用参数:

-X是指定代理协议

  • 4是socks4协议
  • 5是socks5协议

-x是指定代理服务器和端口[代理服务器:端口]

  • 默认socks使用1080
  • HTTPS使用3128

“The first 90% of the code accounts for the first 90% of the development time. The remaining 10% of the code accounts for the other 90% of the development time.” – Tom Cargill

标  题ssh通过http或者socks代理连接远程服务器
作  者Leif160519
出  处https://github.icu/articles/2021/05/25/1621933732647.html
关于博主:坐标南京,运维工程师,如有问题探讨可以直接下方留言。
声援博主:如果您觉得文章对您有帮助,可以评论、订阅、收藏。您的鼓励是博主的最大动力!