Skip to content

Instantly share code, notes, and snippets.

@mimukit
Last active October 11, 2024 11:38
Show Gist options
  • Save mimukit/c284df9654edf027e47da8343b8c3846 to your computer and use it in GitHub Desktop.
Save mimukit/c284df9654edf027e47da8343b8c3846 to your computer and use it in GitHub Desktop.
Quick guide for SSH setup on macOS
  1. Setup ssh key on your pc (skip this step if you already have it)

    ssh-keygen -t rsa -b 4096 -C "[email protected]"
    
    • Start the ssh-agent in the background.
    eval "$(ssh-agent -s)"
    
    • Add your SSH private key to the ssh-agent and store your passphrase in the keychain.
    ssh-add -K ~/.ssh/id_rsa
    
  2. Copy ssh key to clipboard

    • Run the command below to copy the ssh key to your clipboad
    pbcopy < ~/.ssh/id_rsa.pub 
    
  3. Test github setup

    • Run the command below to terminal
    ssh -T [email protected]
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment