"mac์์ ์ฌ๋ถํ ํ ๋๋ง๋ค git push๊ฐ ์๋๋ ๋ฌธ์ ํด๊ฒฐ"
mac์ผ๋ก ๊ฐ์ํ ํ ์ ์ฌ์ฉํ๊ณ ์๋ github๊ณ์ ์ push๋ฅผ ํ๋ ค๊ณ ํ์ ์๋์ ๊ฐ์ ๋ฉ์์ง๊ฐ ๋ํ๋ฌ๋ค.
git@github.com: Permission denied (publickey).
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
1์ฐจ์ ์ผ๋ก๋ ์ด์ ์ ํฌ์คํ ํ ์ ์ด ์๋, ์๋์ ๊ธ๋ก ํด๊ฒฐ์ด ๋๋ค.
https://gentlesark.tistory.com/86
Git Push๋ฅผ ๊ท์ฐฎ๊ฒ ๋ง๋๋ ์๋ฌ ํด๊ฒฐ: Enter passphrase for key '~/.ssh/id_rsa' ๋ฌธ์ ์ Could not open a connection to
์ธ์ ๊ฐ๋ถํฐ https๋ก git repository๋ก๋ถํฐ ์์ค๋ฅผ ๋ฐ์ ๋ ์๊พธ ๊ณ์ ํ์ธ์ด ๋จ๋๊ฒ ๊ท์ฐฎ์๋ค. ๊ทธ๋์ ssh key๋ฑ๋ก์ ํ๊ณ ํ๋ฒ ๊ท์ฐฎ์์ ๊ฐ์ํ๊ณ ๊ณ์ ํธํ๊ฒ ํ๋ ค๊ณ ssh ์ค์ ์ ๊ฐํํ๋ค. git push์ ์
gentlesark.tistory.com
mac์์ ssh-key ์์ฑํ๊ธฐ(ssh-keygen)
1. ํฐ๋ฏธ๋์ ์คํํ๋ค. (์์ ๊ฐ์ ์์ด์ฝ) 2. ์๋์ ๋ช ๋ น์ด๋ฅผ ์คํํ๋ค. (์ด๋ฉ์ผ ์ฃผ์๋ ๋ณธ์ธ์ ๋ง๊ฒ ๋ณ๊ฒฝ) ssh-keygen -C "abcd@naver.com" 3. ์๋์ ๋ฉ์์ง๊ฐ ๋์ค๋ฉด Enter๋ฅผ ์ ๋ ฅํ๋ค. (๊ธฐ๋ณธ ๊ฒฝ๋ก์ ์ ์ฅ
gentlesark.tistory.com
ssh-add -l
์ ์
๋ ฅํด๋ณด๋ฉด ์ ์ ์๋ค. ์๋์ ๊ฐ์ด ๋์ฌ ๊ฒ์ด๋ค.The agent has no identities.
ssh-add -l
๋ฅผ ์
๋ ฅํ์ ๋ ์๋ฌด๊ฒ๋ ๋จ์ง ์์๋ ์๊ด์๋ค.) ์ฐธ๊ณ ์๋ฃ๋ ๋งจ ๋ค์ ๋ถ์ฌ๋ฃ๊ฒ ๋ค.ํด๊ฒฐ๋ฐฉ๋ฒ
macOS Sierra ์ดํ๋ก๋ ํค์ฒด์ธ์ ์ฌ์ฉํ๋ ์๋์ ๊ฐ์ ๋ฐฉ๋ฒ์ผ๋ก ssh-key๊ฐ ์์์ ์ผ๋ก๋ง ์ ์ฅ๋๋ ๋ฌธ์ ๋ฅผ ํด๊ฒฐํ ์ ์๋ค.
vi ~/.ssh/config
Host *
IdentityFile ~/.ssh/id_rsa
UseKeyChain yes
AddKeysToAgent yes
์ถ๊ฐ์ ์ผ๋ก Passphrase๋ ์ ๋ ฅ์ด ๊ท์ฐฎ๊ธฐ๋ ํด์
ssh-keygen -p
๋ช ๋ น์ด๋ฅผ ํตํด์ ์์ ์ฃผ์๋ค.
์ฐธ๊ณ ์๋ฃ
https://unix.stackexchange.com/questions/140075/ssh-add-is-not-persistent-between-reboots
ssh-add is not persistent between reboots
I added a ssh key to the agent by: $ ssh-add ~/.ssh/id_rsa_mac Identity added: /Users/alex/.ssh/id_rsa_mac (/Users/alex/.ssh/id_rsa_mac) After a reboot the agent doesn't have this key added anymo...
unix.stackexchange.com
https://gentlesark.tistory.com/65
git push์ ์๋ ๋ก๊ทธ์ธ ์ค์ - SSH ์ค์ ์ผ๋ก username, password ๊ทธ๋ง ์ ๋ ฅํ์
github respository์ git push -u origin master ๋ฅผ ํ์ ๋ ์๋์ ๊ฐ์ด ์๊พธ ๋ก๊ทธ์ธ์ ์์ฒญํ๋ ๊ฒฝ์ฐ ํด๊ฒฐ ๋ฐฉ๋ฒ ์ ๋ฆฌ. repository์ฃผ์๋ฅผ https ๋ก ๋ฐ์์ ์ฒ๋ฆฌํ๋ ๊ฒฝ์ฐ์ ํ๋กํ ์ฝ์ ssh ๋ก ๋ณ๊ฒฝํ๋ ๋ฐฉ๋ฒ์ด๋ค..
gentlesark.tistory.com
macOS Sierra doesn’t seem to remember SSH keys between reboots
I have to run this command since upgrading to macOS: ssh-add -K Corrects the problem after the reboot but I have to run this command every time I log on to my computer. If I do not run the command
apple.stackexchange.com
๋๊ธ