无法通过 ssh 从远程计算机连接,但可以本地连接

无法通过 ssh 从远程计算机连接,但可以本地连接

我有一台运行 openssh 的 archlinux 计算机,我可以毫无问题地在本地连接到它。但是,当我尝试从另一个网络连接时,我收到错误。SSH 正在监听端口 22,但我将路由器设置为将端口 25 转发到 22,因为我有多个机器设置为通过端口 22 进行 ssh 连接。

使用 putty,I get Incoming packet was garbled on decryption我尝试将 blowfish 移至顶部,并在连接>SSH>密码中尝试将 3DES 移至顶部。我使用的是 putty 版本 .64

使用 MobaXterm 我得到

Bad packet length 1349676916. Disconnecting: Packet corrupt 当我手动运行时

ssh username@ip -vp 25

OpenSSH_6.7p1, OpenSSL 1.0.1g 7 Apr 2014
debug1: Reading configuration data /etc/ssh_config
debug1: Connecting to MY-IP [MY-IP] port 25.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/mobaxterm/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.7
debug1: Remote protocol version 2.0, remote software version OpenSSH_6.0p1 Debian-4+deb7u2
debug1: match: OpenSSH_6.0p1 Debian-4+deb7u2 pat OpenSSH* compat 0x04000000
debug1: SSH2_MSG_KEXINIT sent
Bad packet length 1349676916.
Disconnecting: Packet corrupt

如果我在运行 ssh 时使用 -1,我会得到

Protocol major versions differ: 1 vs. 2

据我所知,端口已正确转发。我还连接了 telnet,得到了

Trying MY-IP...
Connected to MY-IP.
Escape character is '^]'.
SSH-2.0-OpenSSH_6.0p1 Debian-4+deb7u2

我可以连接到网络上的其他机器,然后使用它们通过 ssh 进入这台机器。另外两台机器是树莓派,我觉得尝试使用它们作为接入点可能会导致延迟,所以如果可能的话,我宁愿解决这个问题。

答案1

似乎可以使用端口 35。我没想到端口 25 通常用于其他用途。切换到另一个端口并将其设置为静态 IP 似乎解决了这个问题。

相关内容