GitHubにSSHで接続する
何番煎じわからないけど、備忘録としてまとめる。
SSH keyの作成
cd ~/.ssh/
ssh-keygen -t rsa -b 4096 -C "your_email@gmail.com"
...
Enter file in which to save the key (/Users/you/.ssh/id_rsa): [id_rsa_git]
Enter passphrase (empty for no passphrase): [Type a passphrase]
...
SSH keyをGithubに登録
右上のアイコン -> Settings -> SSH & GPG keys -> New SSH key
- Title: 適当につける
- Key: 作成した
id_rsa_git.pub
の中身をコピペ
ローカルの設定
SSH config
vim ~/.ssh/config
...
Host github.com
User git
Hostname github.com
IdentityFile ~/.ssh/id_rsa_git
...
SSH agent
eval `ssh-agent`
ssh-add ~/.ssh/id_rsa_git
接続確認
ssh github.com
...
Enter passphrase for key '/home/pi/.ssh/id_rsa_git':
PTY allocation request failed on channel 0
Hi xxxxxx! You've successfully authenticated, but GitHub does not provide shell access.
Connection to github.com closed.
...
終わり
ここまでやるとgit cloneできるはず