SSH Public Private Key Pair

SSH Public Private Key Pair

The SSH protocol supports many authentication methods. Arguably one the most important of these is public key authentication for interactive and automated connections.1

The motivation for using public key authentication over simple passwords is security. Public key authentication provides cryptographic strength that even extremely long passwords can not offer. With SSH, public key authentication improves security considerably as it frees the users from remembering complicated passwords (or worse yet, writing them down).2

The SSH employs a public key cryptography. A public-key cryptography, also known as asymmetric cryptography, is a class of cryptographic algorithms which requires two separate keys, one of which is secret (or private) and one of which is public. Together they are known as a key-pair. In SSH, the public key cryptography is used in both directions (client to server and server to client), so two key pairs are used. One key pair is known as a host (server) key, the other as a user (client) key.3


Generate a Key Pair

ssh-keygen -t rsa -b 4096 -P "" -C "your_email@example.com"

Set Linux Permissions

chmod 700 ~/.ssh && chmod 600 ~/.ssh/*

Authorized_keys File in SSH

Last edited by MichaelAlber .
Page last modified on Wednesday February 12, 2020 15:12:07 UTC.