Logo

dev-resources.site

for different kinds of informations.

how to get SSH Keys for gitlab for mac?

Published at
1/10/2025
Categories
gitcommand
Author
Pheak Pheasa
Categories
1 categories in total
gitcommand
open
how to get SSH Keys for gitlab for mac?
  1. Generate SSH Key Run this command in your terminal to generate a new SSH key:
   ssh-keygen -t rsa -b 4096 -C "[email protected]"
  • Press Enter to save it in the default location.
  • Set a passphrase or leave it empty for no passphrase.
  1. Start SSH Agent Start the SSH agent to manage your keys:
   eval "$(ssh-agent -s)"
  1. Add SSH Key Add your new key to the SSH agent:
   ssh-add -K ~/.ssh/id_rsa
  1. Copy SSH Key Copy your SSH public key to paste into GitLab:
   pbcopy < ~/.ssh/id_rsa.pub
  1. Add Key to GitLab
    • Go to GitLab > Settings > SSH Keys.
    • Paste the copied key in the key field and add a title.

Done! Now you can clone or push to repositories securely.

Featured ones: