SSH key

An SSH key is a cryptographic key used with Secure Shell to authenticate a user or host, with a private key proving possession and a corresponding public key used for verification.

Public and private have different jobs

For user public-key authentication, the SSH client signs authentication data with the private key. The server checks the signature and whether that public key is acceptable for the requested account. The private key does not need to be sent to the server. The server may also require another authentication method.

Host keys serve a different side of the connection: they help the client authenticate the server. Do not confuse a server’s host key with a key authorized to sign in to an account on that server.

A public key can still be an access change

The public half is not a secret. Authorizing it for an account is nevertheless a security decision, because the matching private key can then participate in authentication as that account.

In OpenSSH, authorization may use an account’s authorized keys configuration or a trusted certificate authority, among other supported arrangements. The account’s permissions and effective restrictions determine what a connection can do. A key addition does not automatically mean unrestricted administrator access, but a modest task description does not enforce a restriction either.

Verify the holder, host, account, and approved work before adding access. A filename or key comment is a label, not proof of who controls the private key. The SSH key access guide explains that review, including why removal of future authentication access needs to be distinguished from handling connections already established.

Sources

See it in practice