Skip to main content

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.

CommandsUseBreakdown
ls ~/.shShow me all SSH-related files in my home directory.NA
ssh-keygen -o -t rsa -b 4096 -C username@computer or username@domainSSH key creation commandssh-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