我立即与 SSH 断开连接(几乎被锁定)

我立即与 SSH 断开连接(几乎被锁定)

我无法通过 SSH 登录到我的 Debian Wheezy 服务器。

我更改了 ssh_config 和 sshd_config 中的 Ciphers 和 KeyExchange 选项。奇怪的是,我在另外两台相同的机器上进行了相同的更改,却没有遇到任何问题。

幸运的是,我有 VNC 访问权限,可以进入机器进行任何更改。

我现在已将我的 ssh 配置恢复正常,但问题仍然存在:

debug1: Connecting to myserv.com [server_ip] port 443.
debug1: Connection established.
debug3: Incorrect RSA1 identifier
debug3: Could not load "/Users/antd/.ssh/id_rsa" as a RSA1 public key
debug1: identity file /Users/antd/.ssh/id_rsa type -1
debug1: identity file /Users/antd/.ssh/id_rsa-cert type -1
debug1: identity file /Users/antd/.ssh/id_dsa type -1
debug1: identity file /Users/antd/.ssh/id_dsa-cert type -1
debug1: identity file /Users/antd/.ssh/id_ecdsa type -1
debug1: identity file /Users/antd/.ssh/id_ecdsa-cert type -1
debug1: identity file /Users/antd/.ssh/id_ed25519 type -1
debug1: identity file /Users/antd/.ssh/id_ed25519-cert type -1
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_6.6.1
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
debug2: fd 3 setting O_NONBLOCK
debug3: put_host_port: [myserv.com]:443
debug3: load_hostkeys: loading entries for host "[myserv.com]:443" from file "/Users/antd/.ssh/known_hosts"
debug3: load_hostkeys: loaded 0 keys
debug1: SSH2_MSG_KEXINIT sent
disconnected

重新启动 SSH 服务后:

sh-4.2$ sudo /etc/init.d/ssh restart
Could not load host key: /etc/ssh/ssh_host_rsa_key
[....] Restarting OpenBSD Secure Shell server: sshdCould not load host key: /etc/ssh/ssh_host_rsa_key

SSH 甚至没有要求我输入密码......

如果有人能帮助我恢复 SSH,我将不胜感激!!

答案1

我通过发出以下命令解决了该问题:

sudo ssh-keygen -t rsa -f /etc/ssh/ssh_host_rsa_key

出于某种原因,现在一切都正常了。

相关内容