无法使用 ssh 登录我的服务器

无法使用 ssh 登录我的服务器

昨天我正在迁移到我的新服务器,需要使用 rsync,我创建了一个 RSA 密钥,以便 rsync 可以连接,我看到一个错误,说add to trusted key in location x我在新服务器上没有该位置,所以基本上当我这样做mv rsakey /location.x时目录不存在。

我尝试重新生成密钥。但这没有帮助,现在我无法登录 ssh 也无法登录 filezillascp protocol它说

Error: Network error: Software caused connection abort. Error: Could not connect to server

我几乎可以肯定该错误是由 RSA 密钥引起的。我该如何修复它?顺便说一下我有ISPCP安装了,所以我也许可以从那里修复它。

笔记:我已经在旧服务器和新服务器上生成了 RSA 密钥,我可以登录旧服务器,但不能登录新服务器。

编辑

在 ubuntu 12.04 上使用终结者:

$ ssh root@server_ip
Connection closed by server_ip

编辑2

完成后,mv ~/.ssh ssh_backup我尝试连接,它说Read from socket failed: Connection reset by peer我重试了,它给了我connection closed上面显示的错误

编辑3

的输出ssh -vv root@server_ip

OpenSSH_5.9p1 Debian-5ubuntu1, OpenSSL 1.0.1 14 Mar 2012
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to my_ip_address [my_ip_address] port 22.
debug1: Connection established.
debug1: identity file /home/me/.ssh/id_rsa type -1
debug1: identity file /home/me/.ssh/id_rsa-cert type -1
debug1: identity file /home/me/.ssh/id_dsa type -1
debug1: identity file /home/me/.ssh/id_dsa-cert type -1
debug1: identity file /home/me/.ssh/id_ecdsa type -1
debug1: identity file /home/me/.ssh/id_ecdsa-cert type -1
debug1: Remote protocol version 2.0, remote software version OpenSSH_5.5p1 Debian-6+squeeze3
debug1: match: OpenSSH_5.5p1 Debian-6+squeeze3 pat OpenSSH*
debug1: Enabling compatibility mode for protocol 2.0
debug1: Local version string SSH-2.0-OpenSSH_5.9p1 Debian-5ubuntu1
debug2: fd 3 setting O_NONBLOCK
debug1: SSH2_MSG_KEXINIT sent
Connection closed by my_ip_address

@马特德姆我命名该位置是x因为我忘记了它是什么,您知道该错误,它基本上表示:请将 rsa 密钥移至可信来源位置,或类似的内容。也许是/.ssh

答案1

解决此问题的一种相当彻底的方法是删除您的 ssh 凭据。在您的本地计算机上:

mv ~/.ssh ssh_backup

然后再次尝试 ssh 进入服务器,它应该要求输入密码。您现在可以重新启动生成 RSA 密钥的过程。

相关内容