호스트 키 확인 실패 SSH Github

호스트 키 확인 실패 SSH Github

GitHub 저장소를 안전하게 복제하기 위해 비교적 간단한 접근 방식을 취했지만 여전히 어려움을 겪고 있습니다.

내 Mac에서 이름을 MyKey로 지정하고 비밀번호는 지정하지 않았습니다.

ssh-keygen -t rsa

읽기 및 쓰기 액세스 권한으로 공개 키의 내용을 GitHub에 업로드했습니다. 그런 다음 서버에서 다음 명령을 실행했습니다.

cat > /root/.ssh/github.id_rsa << EOF
-----BEGIN OPENSSH PRIVATE KEY-----
The private key 
-----END OPENSSH PRIVATE KEY-----
EOF

chmod 600 /root/.ssh/github.id_rsa
    
cat > /root/.ssh/config << EOF
    Host github.com
    Hostname github.com
    IdentityFile ~/.ssh/github.id_rsa
EOF
chmod 600 /root/.ssh/config

git clone [email protected]:myname/myproject.git /var/www/test

그러나 내가 얻는 오류는 다음과 같습니다.

Cloning into '/var/www/test'...
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

내가 어디에서 잘못되었을까요?

관련 정보