๐Ÿ“ETC./โš’๏ธ Tool

[Github] git@github.com: Permission denied (publickey). ์—๋Ÿฌ ํ•ด๊ฒฐ

yujch 2022. 10. 8. 01:23
๋ฐ˜์‘ํ˜•

git push ๋˜๋Š” git pull ํ•  ๋•Œ ๋ฐœ์ƒํ•˜๋Š” ์—๋Ÿฌ

 

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.

 

์ƒˆ๋กœ ssh key๋ฅผ ๋งŒ๋“ค์–ด์ค˜์•ผ ํ•จ.

 

ssh key ์ƒ์„ฑ

 ssh-keygen -t rsa -C "{๋ณธ์ธ์˜ ๊นƒํ—ˆ๋ธŒ ์ด๋ฉ”์ผ}"

 

์œ„ ๋ช…๋ น์–ด๋ฅผ ์ž…๋ ฅํ•˜๋ฉด ๋จ.

1. ssh key ์ €์žฅ ์œ„์น˜ ์ง€์ • (์—”ํ„ฐํ•˜๋ฉด ๊ธฐ๋ณธ ์ง€์ •๋œ ์œ„์น˜์— ์ €์žฅ) 

2. ๋น„๋ฐ€๋ฒˆํ˜ธ ์ง€์ • (์—”ํ„ฐํ•ด์„œ ๋„˜๊ธฐ๊ธฐ ๊ฐ€๋Šฅ)

 

 

sshํ‚ค ํ™•์ธํ•˜๊ธฐ

cat ~/.ssh/id_rsa.pub

์œ„ ๋ช…๋ น์–ด๋กœ ๋‚˜์˜จ ํ‚ค๋ฅผ GitHub์— ๋“ฑ๋กํ•˜๊ธฐ

Settings -> SSH and GPC Keys -> New SSH key -> Key ๋ถ€๋ถ„์— ์œ„์—์„œ ํ™•์ธํ•œ sshํ‚ค ๋ณต๋ถ™ํ•˜๊ธฐ

 

๋ฐ˜์‘ํ˜•