Date : 2017/08/30.
- Create GitHub account.
- Generate SSH key.
ssh-keygen -t rsa -b 4096 -C "[email protected]" -f github
- Look and copy SSH public key.
cat ~/.ssh/github.pub
- Import SSH public key on GitHub.
- copy the public key(plain text)
- paste the public key on Github settings page.
- Checking SSH connection.
If connection is ok, you can see
# base syntax ssh -T user@hostname # example ssh -T [email protected] # self-defined host name ssh -T [email protected]
Hi (your name)! You've successfully authenticated, but GitHub does not provide shell access.
- If you need to set multi SSH keys, you can try to add config file.
And then you can add below configure into the config file.
touch ~/.ssh/config vi ~/.ssh/config
Host [email protected] HostName github.com User git IdentityFile ~/.ssh/github