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 Federico Federico3261 6월 22일 09:59 id_rsa

키를 읽기 보호해야 합니다.

chmod 600 .ssh/id_rsa

관련 정보