Skip to content

Instantly share code, notes, and snippets.

@yysskk
Created December 6, 2015 06:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save yysskk/b9da3b96c43cc709ac7c to your computer and use it in GitHub Desktop.
Save yysskk/b9da3b96c43cc709ac7c to your computer and use it in GitHub Desktop.
$ cd ~/.ssh/
$ ssh-keygen -t rsa -C "メールアドレス"
Generating public/private rsa key pair.
Enter file in which to save the key (/Users/ユーザー名/.ssh/id_rsa): github_id_rsa
Enter passphrase (empty for no passphrase):
Enter same passphrase again:
Your identification has been saved in github_id_rsa.
Your public key has been saved in github_id_rsa.pub.
~以下略~
$ pbcopy < ~/.ssh/github_id_rsa.pub
Hi {account-name}! You've successfully authenticated,
but GitHub does not provide shell access.
$ ssh -vT git@github.com
$ vi ~/.ssh/config
Host github.com
HostName github.com
IdentityFile ~/.ssh/github_id_rsa
User git
$ ssh -T git@github.com
Hi {account-name}! You've successfully authenticated,
but GitHub does not provide shell access.
Warning: Permanently added the RSA host key for IP address '204.232.175.90' to the list of known hosts.
Permission denied (publickey).
$ vi ~/.ssh/known_hosts
~~~~ ファイルの中身 ~~~~
github.com,204.232.175.90 ssh-rsa AAA...
eval `ssh-agent`
$ ssh-add github_id_rsa(秘密鍵名)
$ ssh git@github.com
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment