Please make sure you have the correct access rights and the repository exists.

dana·2022년 10월 4일
1

Debugging

목록 보기
7/10
post-thumbnail

git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.

로컬에서 생성한 프로젝트를 깃헙 레파지토리와 연결시키는 과정에서 다음과 같은 에러메세지를 만났다. 에러의 시작은

The authenticity of host 'github.com (어쩌구)' can't be established.
어쩌구 key fingerprint is SHA256:어쩌구
This key is not known by any other names
Are you sure you want to continue connecting (yes/no/[fingerprint])? y

// 여기서 yes를 하는게 아니었음..
Please type 'yes', 'no' or the fingerprint: yes
Warning: Permanently added 'github.com' (ED25519) to the list of known hosts.

요렇게 키가 맞지 않는다는 안내문구가 떴음에도 그냥 무작정 yes를 눌러버린 것..
그랬더니 해당 레포에 접근이 불가능하다는 제목의 안내메세지가 떴다.

에러 해결 방법을 위해 블로그를 찾던 도중 해당 컴퓨터의 SSH키가 깃헙의 키와 일치하지 않아 생기는 문제라는 글을 보았는데, 나의 경우 다른 레파지토리의 접근은 가능하던 상태여서 키 일치의 문제가 아니라고 생각해 다른 방법을 찾아보았다.

에러에 대해 설명한 블로그를 참고해 코드를 입력해주었다. 처음에 무작정 블로그에 작성된 코드를 따라했다가 뒤의 푸쉬명령어 때문에 동작하지 않는 것 같아 git remote set-url 설명을 보고 해당 템플릿에 맞춰 다시 작성해주었더니 에러가 해결되었다.

usage: git remote set-url [--push] <name> <newurl> [<oldurl>]
   or: git remote set-url --add <name> <newurl>
   or: git remote set-url --delete <name> <url>
git remote set-url origin https://github.com/deli-ght/csrssr_practice
profile
PRE-FE에서 PRO-FE로🚀🪐!

0개의 댓글