反向ssh不起作用。ssh_exchange_identification:远程主机关闭连接


1

这是我在服务器(A)中运行以打开隧道:

ssh -vf -N -T -R 222:localhost:22 me@myserverip -p 2222

这是我在myserver服务器(B)上运行以使用隧道:

ssh -vp 222 me@localhost

这是尝试使用隧道后的日志:

B:

OpenSSH_7.2p2 Ubuntu-4ubuntu2.2, OpenSSL 1.0.2g  1 Mar 2016
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug1: Connecting to localhost [127.0.0.1] port 1975.
debug1: Connection established.
debug1: identity file /home/aran/.ssh/id_rsa type 1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/aran/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_7.2p2 Ubuntu-4ubuntu2.2
ssh_exchange_identification: Connection closed by remote host

A:

debug1: client_input_channel_open: ctype forwarded-tcpip rchan 2 win 2097152 max 32768
debug1: client_request_forwarded_tcpip: listen localhost port 1975, originator 127.0.0.1 port 51384
debug1: connect_next: host localhost ([127.0.0.1]:22) in progress, fd=4
debug1: channel 0: new [127.0.0.1]
debug1: confirm forwarded-tcpip
debug1: channel 0: connection failed: Connection refused
connect_to localhost port 22: failed.
debug1: channel 0: free: 127.0.0.1, nchannels 1

任何人都可以向我解释我在这里缺少什么吗?


我现在正在遇到一模一样的问题。现在我正在阅读你的问题,我想知道它是否与IPv4 vs IPv6和SSHD守护进程没有绑定端口有关:22在127.0.0.1
Matthias Steinbauer

Answers:


By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.