How to add a public SSH Key to Github:
1. Register a Github account if you don't have one.
2. Replace my name and email address in the following steps with the ones you used for your Github account:
git config --global color.ui true3. Print your public SSH key using cat command:
git config --global user.name "YOUR NAME"
git config --global user.email "YOUR@EMAIL.com"
ssh-keygen -t rsa -b 4096 -C "YOUR@EMAIL.com"
cat ~/.ssh/id_rsa.pubAnd then, the shell terminal will display a long text staring with ssh-rsa and ending with "YOUR@EMAIL.com"
ssh-rsa
blah blah blah
YOUR@EMAIL.com
4. In Firefox:
- Go to URL: https://github.com/settings/keys
- Click the New SSH Key button
- In the Title text box, give it a name (e.g. Desktop)
- In the Key text box, copy and paste your public SSH key from Step 3 to the text box
- Click the Add SSH Key button
5. To check if it works, in Linux shell terminal, type:
ssh -T git@github.comand type "yes" and the prompt.
6. You should get a message like this:
Hi jimmy2046! You've successfully authenticated, but GitHub does not provide shell access.
References:
https://gorails.com/setup/ubuntu/16.04#git
No comments:
Post a Comment