Connect with SSH through a proxy

后端 未结 11 1631
我在风中等你
我在风中等你 2020-12-12 09:03

I have no real idea what I\'m doing here so please bear that in mind if you can help me!

I am trying to connect to my virtual server through a proxy but I can\'t con

11条回答
  •  甜味超标
    2020-12-12 09:53

    I was using the following lines in my .ssh/config (which can be replaced by suitable command line parameters) under Ubuntu

    Host remhost
      HostName      my.host.com
      User          myuser
      ProxyCommand  nc -v -X 5 -x proxy-ip:1080 %h %p 2> ssh-err.log
      ServerAliveInterval 30
      ForwardX11 yes
    

    When using it with Msys2, after installing gnu-netcat, file ssh-err.log showed that option -X does not exist. nc --help confirmed that, and seemed to show that there is no alternative option to handle proxies.

    So I installed openbsd-netcat (pacman removed gnu-netcat after asking, since it conflicted with openbsd-netcat). On a first view, and checking the respective man pages, openbsd-netcat and Ubuntu netcat seem to very similar, in particular regarding options -X and -x. With this, I connected with no problems.

提交回复
热议问题