すごくメモ帳

すごくほぼメモ帳ぐらいなブログ

GitHub 公開鍵認証

パソコン側

ssh-keygen
cd .ssh
chmod 600 id_rsa

echo -e "\n\n" >> config
echo Host github.com >> config
echo -e "  User git" >> config
echo -e "  Hostname github.com" >> config
echo -e "  IdentityFile ~/.ssh/id_rsa" >> config

cat id_rsa.pub # 文字列をすべてコピーしておく。

GitHub

Githubの右上のアイコン → "Settings" → "SSH and GPG keys" → "New SSH Key"

"Title"は適当に入れる。 "Key"はコピーしたものをそのまま貼付する。

うまくいってるか確認

パソコンで以下のコマンドを実行する。

ssh -T git@github.com