Generate ssh keys
Using the SSH protocol, you can connect and authenticate to remote servers and services. With SSH keys, you can connect to GitHub without supplying your username or password at each visit. You can now use ssh to clone the repo
and initialize all submodules.
Generate a ssh key
ssh-keygen -t rsa -b 4096 -C "your_email@example.com"
Adding your SSH key to the ssh-agent
Start the ssh-agent in the background
eval "$(ssh-agent -s)"
Add key to ssh agent
ssh-add ~/.ssh/id_rsa
Add key to Github
The easiest way to copy the contents of the public key to your clipboard is to use xclip.
xclip -sel clip < ~/.ssh/id_rsa.pub
To manually copy the contents to the clipboard, do the following.
gedit ~/.ssh/id_rsa.pub # Select everything, right-click, & copy.
After:
- In the upper-right corner of any page, click your profile photo, then click Settings.
- In the user settings sidebar, click SSH and GPG keys.
- Click New SSH key or Add SSH key.
- In the "Title" field, add a descriptive label for the new key.
- Click Add SSH key.