0
0
Linux CLIscripting~5 mins

SSH key generation (ssh-keygen) in Linux CLI - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is the purpose of the ssh-keygen command?
The ssh-keygen command creates a pair of keys (a public key and a private key) used to securely connect to remote computers without using passwords.
Click to reveal answer
beginner
What files are created by default when you run ssh-keygen without options?
By default, ssh-keygen creates two files in your ~/.ssh/ folder: id_rsa (private key) and id_rsa.pub (public key).
Click to reveal answer
beginner
Why should you keep your private key safe and never share it?
The private key is like a secret password. If someone else gets it, they can access your remote computers as if they were you. Only share the public key.
Click to reveal answer
beginner
How do you add a passphrase to your SSH key during generation?
When running ssh-keygen, it asks for a passphrase. You can type a secret phrase to add extra protection to your private key.
Click to reveal answer
intermediate
What is the command to generate an SSH key with RSA algorithm and 4096 bits key size?
Use ssh-keygen -t rsa -b 4096 to create a strong RSA key with 4096 bits length.
Click to reveal answer
What does the ssh-keygen command generate?
AA configuration file for SSH
BA password for SSH login
CA new SSH server
DA pair of public and private keys
Where are SSH keys stored by default after running ssh-keygen?
A/usr/bin/
B/etc/ssh/
C~/.ssh/
D/var/log/
Which file contains the public key after generating SSH keys?
Aid_rsa.pub
Bid_rsa
Cauthorized_keys
Dconfig
What is the benefit of adding a passphrase to your SSH key?
AAutomatically uploads the key to servers
BAdds extra security by encrypting the private key
CAllows multiple users to share the key
DMakes the key generation faster
How do you specify the key type and size when generating an SSH key?
Assh-keygen -t rsa -b 4096
Bssh-keygen --type rsa --size 2048
Cssh-keygen -key rsa -size 1024
Dssh-keygen -generate rsa 4096
Explain the process and purpose of generating SSH keys using ssh-keygen.
Think about how you can log in to a remote computer safely without typing a password every time.
You got /4 concepts.
    Describe how to generate a strong SSH key with a passphrase and where the keys are stored.
    Remember the command syntax and the default folder for SSH keys.
    You got /4 concepts.