• 0 Posts
  • 4 Comments
Joined 1 year ago
cake
Cake day: June 10th, 2023

help-circle



  • Perhyte@lemmy.worldtoProgrammer Humor@lemmy.mlCorrection
    link
    fedilink
    English
    arrow-up
    8
    ·
    1 year ago

    If you’re using OpenSSH, the IdentityFile configuration directive selects the SSH key to use.

    Add something like this to your SSH config file (~/.ssh/config):

    Host github.com
      IdentityFile ~/.ssh/github_rsa
    
    Host gitlab.com
      IdentityFile ~/.ssh/gitlab_rsa
    

    This will use the github_rsa key for repositories hosted at github.com, and the gitlab_rsa key for repositories hosted at gitlab.com. Adjust as needed for your key names and hosts, obviously.