Skip to content

Instantly share code, notes, and snippets.

@aduzsardi
Created July 25, 2017 07:27
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 aduzsardi/a95cd87966ca13ac159f0273bdd400cd to your computer and use it in GitHub Desktop.
Save aduzsardi/a95cd87966ca13ac159f0273bdd400cd to your computer and use it in GitHub Desktop.
ssh-keygen command options and examples
SSH-KEYGEN
ssh-keygen
- generate ssh authentication keys
- default RSA key
- -t option for other types DSA,ECDSA,ED25519
- can generate DH (Diffie-Hellman group exchange DH-GEX)
- can generate and update Key Revocation Lists
OPTIONS
-A = create sshd keys (host keys)
-t = type of key pair RSA (default , minim 768 bits , 2048 default ) , DSA (exactly 1024 bits) , ECDSA (elliptic curve 256, 384 or 521 bits) , ED25519 (fixed length bits)
-B = generate bubblebabble digest , specify pub key with -f
-b = number of bits length for the keys
-C = comment for the key pairs
-e = export private or public key to other formats (ex: PuTTY)
-i = import private or public key from other formats (ex: PuTTY-gen)
-l = generates key fingerprint
-p = password for the private key (encrypt the private key) , remove password
-P = old password (ssh-keygen -p -P oldpassword -N newpassword)
-N - new password (ssh-keygen -p -P oldpassword -N newpassword)
-y - read private key and print public key out
-R - remove host public key from known_hosts
MODULI GENERATION
CERTIFICATES
KEY REVOCATION LISTS
EXAMPLES
ssh-keygen -t rsa - generate RSA key-pair (default)
ssh-keygen -t dsa - generate DSA key-pair
ssh-keygen -t ecdsa - generate elliptic curve dsa key-pair
ssh-keygen -t rsa -N keypassword - generate rsa encrypted key-pair , with key password 'keypassword'
ssh-keygen -p -f ~/.ssh/id_rsa - remove or change encryption password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment