duancifu6769 2017-01-03 04:01
浏览 50

SSH侦听器未关闭

I'm trying to write a go application that would allow me to perform reverse ssh tunneling between a Windows machine and a Linux machine using the go ssh library.

In the process of doing so, I create a listener on the remote machine, as follows: remoteListener, err := sshClient.Listen("tcp", remoteString)

where sshClient is an object of type ssh.Client and is configured to connect to the remote machine.

The issue here is that when the sshd process on the Linux machine disrupts the connection with the application, the ssh Listener remains alive on the remote machine. So, reconnecting with the application fails because a listener is already running on the same port on the remote machine.

How do I get around this issue? Does the ssh library allow me to define a timeout on the listener?

  • 写回答

1条回答

  • douxi9245 2017-01-30 07:22
    关注

    I'm just waiting for the timeout after reconnecting. I found no other easy solution for this.

    评论

报告相同问题?

悬赏问题

  • ¥15 c程序不知道为什么得不到结果
  • ¥40 复杂的限制性的商函数处理
  • ¥15 程序不包含适用于入口点的静态Main方法
  • ¥15 素材场景中光线烘焙后灯光失效
  • ¥15 请教一下各位,为什么我这个没有实现模拟点击
  • ¥15 执行 virtuoso 命令后,界面没有,cadence 启动不起来
  • ¥50 comfyui下连接animatediff节点生成视频质量非常差的原因
  • ¥20 有关区间dp的问题求解
  • ¥15 多电路系统共用电源的串扰问题
  • ¥15 slam rangenet++配置