SSH-KEYGEN Commands Cheat Sheet

Here is a cli commands cheat sheet for SSH-KEYGEN command, you can use this as a quick reminder for basic commands with a brief description for each of the commands.

What is SSH-KEYGEN command?

Add some data here

        ---
tags: [ ssh ]
---
# To generate an SSH key:
ssh-keygen -t rsa

# To generate a 4096-bit SSH key:
ssh-keygen -t rsa -b 4096

# To generate a FIDO/U2F token-backed key:
ssh-keygen -t ed25519-sk

# To generate a FIDO2 resident key:
ssh-keygen -t ed25519-sk -O resident

# To update a passphrase on a key:
ssh-keygen -p -P  -N  -f 

# To remove a passphrase on a key:
ssh-keygen -p -P  -N '' -f 

# To generate a 4096 bit RSA key with a passphase and comment containing the user and hostname:
ssh-keygen -t rsa -b 4096 -C "$USER@$HOSTNAME" -P 

# To print the fingerprint of a public key:
ssh-keygen -lf 

# To print the Github-style (MD5) fingerprint of a public key:
ssh-keygen -E md5 -lf 

# To download resident keys from a FIDO2 authenticator to the current directory:
ssh-keygen -K

# To view the public key associated with a private key:
ssh-keygen -y -f  > 
ssh-keygen -y -f ~/.ssh/private-key > ~/.ssh/public-key.pub
    

Check out the SSH-KEYGEN command documentation .


You can also check our MegaSh cheatsheet tool, that has 150+ searchable linux cheat sheets in one page, so you never forget a command as you work again

Check Also

Best AI tools list