What is an SSH key
An SSH key is a secure way to log into another computer or server without typing a password every time it is a pair of cryptographic keys:
- Private key – stays on your computer
- Public key – copied to the server you want to access
They are mathematically linked.
| Commands | Use | Breakdown |
|---|---|---|
| ls ~/.sh | Show me all SSH-related files in my home directory. | NA |
| ssh-keygen -o -t rsa -b 4096 -C username@computer or username@domain | SSH key creation command | ssh-keygen:Generates an SSH key pair. -o: Uses the new OpenSSH private key format. -t rsa: Specifies the key type. -b 2048: Sets key size to 2048 bits. -C: Adds a comment to the public key, used only for identification |