Linux
SSH key setup: how public-key login works
SSH public-key authentication lets a server verify that a connecting client possesses the matching private key. The private key stays with the client; the public key can be placed on servers that should accept that identity.
Generate keys on a trusted client
Use a current supported key type and tool, protect the private key, and add a passphrase where the operational workflow supports it. Do not email or paste private keys into random control panels or chat systems.
Install only the public key on the server
The server normally stores authorized public keys for the account. File ownership and permissions matter because SSH can refuse unsafe authorization files even when the key text is correct.
Use separate identities for automation and people
A personal administrator key should not become the permanent credential for every backup job or deployment system. Dedicated credentials can be scoped, audited, and revoked without interrupting unrelated access.
Test key login before disabling fallback access
Verify a new key from a separate session and keep console or recovery access available. Only then tighten password or root-login policy according to the server’s management model.