vscode github permission denied (publickey)

 

개요


윈도우 환경에서 위와 같이 잘 설치하고 쓰던 중
 

ctrl+shift+p 에서 git clone 으로 clone하려는데 갑자기 위와 같은 permission denied 에러가 발생합니다.

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.

이런 로그가 발생했는데 이유를 모르겠네요.
어쩌겠습니까 그래도 해결해야죠.

진단

일단 때려맞추기로 c:\users\<사용자명>\.ssh 에 가서 있는 파일을 모두 지워봅니다.

cd c:\users\<사용자명>\.ssh
del known_hosts

다시 git clone 시도해봅니다.





이게 뭔가..

C:\work>git clone git@github.com:Shaun289/shaun289.github.io.git
Cloning into 'shaun289.github.io'...
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.

gitcmd 에서 clone 해봤더니 위와 같습니다.
좀 더 정확한 로그를 볼 수 있네요.


임시 해결책


일단 검색해보니 이렇게 나옵니다.
아마도 보안이슈때문에 id_ed25519 로 바꾸면서 생긴 이슈 같은데, 




여기 쓰레드에 나온 내용 중에 맨 마지막 방법만 잘 동작하네요. 
우측 하단의 "원격 소스" 를 선택하면 미리 등록된 github 계정의 repository 들이 보이고 clone이 가능하네요.
일단 이 방법을 써야겠습니다.




그렇다면 문제가 발생하는 vscode 버전이 중요하겠네요. 
버전은 1.73.0 입니다.


댓글

이 블로그의 인기 게시물

WSL2 Ubuntu 20.04 및 네트워크 설정

리눅스 멀티코어를 사용하는 tar 압축/해제

git pull 을 했더니 branch가 갈라지는 경우