0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

SSH Keyを生成してGithubに登録

Last updated at Posted at 2018-10-24

前提

  • macOS Sierra

作業

SSH Keyを生成

$ ssh-keygen -t rsa -b 4096 -C "hoge@example.com"

~/.sshの中にid_rsaid_rsa.pubが生成されます。

id_rsa → 秘密鍵
id_rsa.pub → 公開鍵

Githubに公開鍵を登録

下記のURLにアクセス
https://github.com/settings/keys

github.com_settings_ssh_new(Laptop with HiDPI screen).png

Keyのところに公開鍵を丸々貼り付けて、Add SSH Keyをクリックします。
pbcopyを使うとクリップボードにコピーできて楽です。

$ pbcopy < ~/.ssh/id_rsa.pub

確認

$ ssh -T git@github.com
Hi m1ul24! You've successfully authenticated, but GitHub does not provide shell access.

successfullyみたいなメッセージがでればOKです

参考URL
https://qiita.com/suthio/items/2760e4cff0e185fe2db9
https://help.github.com/articles/generating-a-new-ssh-key-and-adding-it-to-the-ssh-agent/

0
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?