1
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.

Github ssh setting cheatcheet

Last updated at Posted at 2019-03-03

Overview

Cheetsheet of How to set up for ssh to github comfortably.
(macbook買い直した時などgithubを爆速で設定する方法)

Make ssh keys

$ ssh-keygen -t rsa -b 4096 -C "your email(registerd at github)"

Enter a file name and a passphrase

when a file name is as follows

~/.ssh/github_rsa

Register pub key with github

$ pbcopy < ~/.ssh/github_rsa.pub

in github.com
at Setting > SSH and GPG keys > New SSH key
paste pub key and name it

Avoid Enter passphrase for key

Add ssh config

$ vim ~/.ssh/config

Host *
  UseKeychain yes

Host github github.com
  HostName github.com
  IdentityFile ~/.ssh/github_rsa
  User git

Add ssh key with

$ ssh-add -K ~/.ssh/github_rsa
※ -K Store passphrases in your keychain.

Check

$ ssh -T git@github.com

参考

1
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
1
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?