Skip to content

Instantly share code, notes, and snippets.

@df-a
Forked from anavdesign/SSH Keys.md
Last active March 6, 2023 10:16
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save df-a/e9e3cd2690821c911a61fe6f894be51a to your computer and use it in GitHub Desktop.
Save df-a/e9e3cd2690821c911a61fe6f894be51a to your computer and use it in GitHub Desktop.
SSH: Generate SSH Keys

SSH Keys

Resources


  1. Change Directory

    $ cd ~/.ssh
    
  2. Make Property Directory

    $ mkdir DIR_NAME
    
  3. Creates a new ssh key

    # Use Email as a label
    # When saving, use the email_strength combo as a name
    ## RSA
    ssh-keygen -t rsa -C email@domain.com
    ## alternative strenghts
    # ssh-keygen -t rsa -b 4096
    # ssh-keygen -t dsa 
    # ssh-keygen -t ecdsa -b 521
    # ssh-keygen -t ed25519
    
  4. Create in property directory created in earlier

    /Users/df-a/.ssh/DIR_NAME/id_rsa_email@domain.com
    
  5. Enter Passphrase

    • Strongly recommend a very good, secure passphrase
  6. Ensure ssh-agent is enabled

    eval 'ssh-agent' -s
    
  7. Add Private Key to Mac OSX Keychain

    $ ssh-add -K ~/.ssh/DIR_NAME/id_rsa_email@domain.com
    
  8. Copy id_rsa.pub to your clipboard

    $ pbcopy < ~/.ssh/DIR_NAME/id_rsa.pub
    
  9. Add your SSH key to your External Account or Host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment