mkdir $HOME/.ssh
ssh-keygen -t rsa -b 4096 -C "esmail.shabayek@gmail.com"
- You will then be prompted to "Enter a file in which to save the key." You can specify a file location or press “Enter” to accept the default file location.
- The next prompt will ask for a secure passphrase. A passphrase will add an additional layer of security to the SSH and will be required anytime the SSH key is used.
Enter a file in which to save the key (/Users/you/.ssh/id_rsa): [Press enter] Enter passphrase (empty for no passphrase): [Type a passphrase] Enter same passphrase again: [Type passphrase again]
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/id_rsa
cat ~/.ssh/id_rsa.pub
ssh -T git@github.com
OR
ssh -T git@gitlab.com