트러블슈팅 & 디버깅/Permission

SSH Key 발급&등록하기 - git@github.com: Permission denied (publickey)

rexondex 2025. 6. 8. 01:02

 

fatal: Could not read from remote repository.

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


1. 키 확인

ls -al ~/.ssh

 

2. 새 SSH 키 생성

ssh-keygen -t ed25519 -C "your_email@example.com"

 

3. 깃허브에 SSH 공개 키 추가

cat ~/.ssh/id_ed25519.pub

- 이후 `GitHub 설정 > SSH and GPG keys > Add SSH Key` 진행

 

4. SSH 에이전트 시작 및 키 추가

- ssh-agent를 백그라운드에서 시작

eval "$(ssh-agent -s)"

 

- SSH 개인 키를 ssh-agent에 추가

ssh-add ~/.ssh/id_ed25519

 

5. SSH 연결 테스트

ssh -T git@github.com

 

`Hi <your_username>! You've successfully authenticated, but GitHub does not provide shell access.` 뜨면 성공.