ssh-keygen -t rsa -b 4096 -C "[email protected]" -f ~/.ssh/gitlab25
Rename the result file from ~/.ssh/ to your own name: e.g. gitlab25
gitlab25 gitlab25.pub
ssh-add ~/.ssh/gitlab25
Rename it to
ssh-add -L
The agent has no identities.
eval "$(ssh-agent -s)"
To ensure the agent starts every time you open a terminal, add this to your shell configuration file (~/.bashrc, ~/.zshrc, or ~/.profile):
if [ -z "$SSH_AUTH_SOCK" ]; then
eval "$(ssh-agent -s)"
fi
Once the agent is running, add your key:
ssh-add ~/.ssh/gitlab25
Store your SSH key passphrase (if needed)
Open or create your SSH config file:
vi ~/.ssh/config
Add the lines
Host gitlab.com
IdentityFile ~/.ssh/gitlab25
AddKeysToAgent yes