Add your SSH key to your account
To configure your GitHub account to use your SSH key:
Copy the SSH key to your clipboard. If your key is named id_dsa.pub
, id_ecdsa.pub
orid_ed25519.pub
, then change the filename below from id_rsa.pub to the one that matches your key:
clip < ~/.ssh/id_rsa.pub # Copies the contents of the id_rsa.pub file to your clipboard
Warning: It's important to copy the key exactly without adding newlines or whitespace.
Add the copied key to GitHub:
In the top right corner of any page, click your profile photo, then click Settings.
In the user settings sidebar, click SSH keys.
Click Add SSH key.
- In the Title field, add a descriptive label for the new key. For example, if you're using a personal Mac, you might call this key "Personal MacBook Air".
- Paste your key into the "Key" field.
- Click Add key.
- Confirm the action by entering your GitHub password.
Step 5: Test the connection
To make sure everything is working, you'll now try to SSH into GitHub. When you do this, you will be asked to authenticate this action using your password, which is the SSH key passphrase you created earlier.
Open Git Bash and enter:
ssh -T git@github.com # Attempts to ssh to GitHub
You may see this warning:
# The authenticity of host 'github.com (207.97.227.239)' can't be established. # RSA key fingerprint is 16:27:ac:a5:76:28:2d:36:63:1b:56:4d:eb:df:a6:48. # Are you sure you want to continue connecting (yes/no)?
Verify the fingerprint in the message you see matches the following message, then type
yes
:# Hi username! You've successfully authenticated, but GitHub does not # provide shell access.
If the username in the message is yours, you've successfully set up your SSH key!
If you receive a message about "access denied," you can read these instructions for diagnosing the issue.
If you're switching from HTTPS to SSH, you'll now need to update your remote repository URLs. For more information, see Changing a remote's URL.
'DevOps' 카테고리의 다른 글
AWS EC2 인스턴스의 Amazon Linux 시간 설정 (0) | 2015.07.30 |
---|---|
리눅스에서 디렉토리별 용량 확인 방법 (0) | 2015.07.30 |
Subversion 설치 (0) | 2015.07.24 |
AWS EC2인스턴스에 Volume 추가 (0) | 2015.07.21 |
Brackets 단축키 정리 For Mac (1) | 2015.07.11 |