-
Notifications
You must be signed in to change notification settings - Fork 1
github ssh config
y.imamura edited this page May 29, 2018
·
3 revisions
- GitHub用の秘密鍵、公開鍵を作成
- GitHubに公開鍵を登録
GitHub用の鍵を作成する。(パスフレーズなし)
$ ssh-keygen -t ed25519 -N "" -f ~/.ssh/github -C sample@example.com
-
~/.ssh/github
: 秘密鍵 -
~/.ssh/github.pub
: 公開鍵 -
-t
: 鍵の種類を選択。Ed25519鍵一択です。 -
-C
: GitHubに設定したメールアドレスを指定するのが一般的なようです。 -
-f
: ファイル名を指定。デフォルトだと~/.ssh/id_ed25519
が生成される。 -
-N
: パスフレーズの指定。""
と指定することでパスフレーズなしにしている- セキュリティ力上げるなら設定する。利便性を取るなら設定しない。
* クリップボードに公開鍵をコピー
$ pbcopy < ~/.ssh/github.pub
https://github.com/settings/keys
New SSH key
- Title を適当に入力する(PC名を入れておくと鍵管理しやすい)
- Key に公開鍵をコピーする
Add SSH Key
successfully
のメッセージが出ていればok。
$ ssh -T github.com
Hi xxx! You've successfully authenticated, but GitHub does not provide shell access.