All the commands at one go - (For lazy beings)
ssh-keygen -t rsa -b 4096 -C [email protected] # Generate SSH Key
ls -al ~/.ssh # Verify It
eval "$(ssh-agent -s)" # Max/Linux
ssh-agent -s # Windows
ssh-add ~/ .ssh/id_rsa
pbcopy < ~/ .ssh/id_rsa.pub # Mac/Linux
clip < ~/ .ssh/id_rsa.pub # Windows
cat ~/.ssh/id_rsa.pub # If above don't work
ssh -T [email protected] # Verify
Use Git Bash if using Windows.
ls -al ~/.ssh
If you already have an SSH key, please skip step 1.
ssh-keygen -t rsa -b 4096 -C [email protected]
- You can use the default directory to store the key pair.
- Optionally use a passphrase for an extra layer of security.
You can now verify this key using -
ls -al ~/.ssh
Mac/Linux:
eval "$(ssh-agent -s)"
Windows:
ssh-agent -s
ssh-add ~/ .ssh/id_rsa
Mac/Linux:
pbcopy < ~/ .ssh/id_rsa.pub
Windows:
clip < ~/ .ssh/id_rsa.pub
Go to settings > SSH keys > Add SSH key
- In Title enter the name of your computer
- In Key paste the key
ssh -T [email protected]
Enter Yes.
If you get Hi, then it is done