key_load_public:没有这样的文件或目录

key_load_public:没有这样的文件或目录

我的 Ubuntu 服务器有问题。当我尝试从该服务器 ssh 到第二台服务器时,出现以下错误:

federico@federico:~/.ssh$ ssh [email protected] -vvv
OpenSSH_7.2p2 Ubuntu-4ubuntu1, OpenSSL 1.0.2g-fips  1 Mar 2016
debug1: Reading configuration data /home/federico/.ssh/config
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "federicolivieri.noip.me" port 22
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to federicolivieri.noip.me [95.144.54.179] port 22.
debug1: Connection established.
debug1: key_load_public: No such file or directory
debug1: identity file /home/federico/.ssh/id_rsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/federico/.ssh/id_rsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/federico/.ssh/id_dsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/federico/.ssh/id_dsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/federico/.ssh/id_ecdsa type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/federico/.ssh/id_ecdsa-cert type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/federico/.ssh/id_ed25519 type -1
debug1: key_load_public: No such file or directory
debug1: identity file /home/federico/.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-4ubuntu1
debug1: ssh_exchange_identification: <!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">

debug1: ssh_exchange_identification: <html><head>

debug1: ssh_exchange_identification: <title>400 Bad Request</title>

debug1: ssh_exchange_identification: </head><body>

debug1: ssh_exchange_identification: <h1>Bad Request</h1>

debug1: ssh_exchange_identification: <p>Your browser sent a request that this server could not understand.<br />

debug1: ssh_exchange_identification: </p>

debug1: ssh_exchange_identification: <hr>

debug1: ssh_exchange_identification: <address>Apache/2.4.10 (Raspbian) Server at 127.0.1.1 Port 80</address>

debug1: ssh_exchange_identification: </body></html>

ssh_exchange_identification: Connection closed by remote host

但是我可以在 /home/federico/.ssh/ 下看到 id_rsa

federico@federico:~/.ssh$ ls -l
total 76
-rw-r--r-- 1 federico federico  1265 Jun 29 14:10 config
-rw-r--r-- 1 federico federico  3261 Jun 22 09:59 id_rsa
-rw-r--r-- 1 federico federico   727 Jun 22 09:59 id_rsa.pub
-rw-r--r-- 1 federico federico 11906 Jul 19 09:28 known_hosts.bak
-rw-r--r-- 1 federico federico  9682 Jun 30 09:04 known_hosts.old

我研究了这个错误,但每个人都提出了不同的建议,而这些解决方案对我不起作用。任何想法?

谢谢

答案1

-rw-r--r-- 1 费德里科 费德里科 3261 六月 22 09:59 id_rsa

您必须对密钥进行读保护。

chmod 600 .ssh/id_rsa

相关内容