ssh 失败,因为我无法按 [Enter] 键

ssh 失败,因为我无法按 [Enter] 键

我有两台机器。

  • m1:Solaris Sparc SunOS 5.10
  • m2:ArchLinux 3.4.4
  • m3:Solaris Sparc SunOS 5.10

当我尝试从 m1 登录 m2 时,我无法按 [进入]键,它只显示^M

m1$ export TERM=vt100
m1$ ssh m2
pkcs11 engine does not exist
The authenticity of host 'm2 (192.168.1.2)' can't be established.
RSA key fingerprint is cf:f2:b7:24:d6:d2:b6:fe:b1:e8:72:6d:2b:cd:55:fe.
Are you sure you want to continue connecting (yes/no)? yes^M

我的状态很奇怪

m1$ stty -a
... eol = <undef>

m3$ stty -a
... eol = -^?

我强制 eol 变成 ^M,它可以从 m1 ssh m2,但会生成一条消息:

pkcs11 engine does not exist

如果我从 m3 ssh m2,它将不会显示该消息。

答案1

^M是“回车”的 ASCII 控制代码,而 ssh 期望“换行”,或者^J 如果您按 Ctrl+J,您可能能够登录。

答案2

就我的情况而言,我当前的 Shell(Mac 上的 zsh)出了点问题。关闭终端窗口并再次打开它以ssh再次运行命令解决了问题,我能够再次按 Enter 键登录。

相关内容