It's fairly easy to follow GitHub's official documentation on how to add your SSH key to your account. This version is quickier and you can find all necessary commands below. Follow this if you use a Linux distribution.
You can follow this procedure with a few modifications for GitLab and Bitbucket.
ls -al ~/.ssh
The filenames of the public keys are one of the following:
- id_rsa.pub <-- that's mine
ssh-keygen -t rsa -b 4096 -C "firstname.lastname@example.org"
You'll see this:
> Enter a file in which to save the key (/home/you/.ssh/id_rsa): [Press enter]
Just [press enter] as instructed to use the default location or type one of your preference.
Then you'll be prompt to define a passphrase. Be creative.
To get your ssh public key you can run
ls -al ~/ssh, identify you public key and then
cat its content to the console. For example:
- Go to your GitHub SSH and GPG keys settings page.
- Click New SSH key.
- Choose a good title, like
Living Room Desktop SSH Key.
- Paste your SSH key on the
Now all operations to/from GitHub (
push and others) can be performed safely without typing user and password every time.