SSH public-key authentication proves that a client holds a private key authorized for a particular account. The client signs data tied to the current SSH session, and the server verifies the signature with the corresponding public key. The private key stays with the client or with a signer acting on its behalf, such as a hardware token. Simply knowing or copying a public key does not let someone log in, but being able to add a public key to an account's authorized keys can grant access to that account.
For a development VM, generate a dedicated key pair on a trusted workstation with an OpenSSH command such as ssh-keygen -t ed25519 -f ~/.ssh/dev_vm if both ends and local policy support Ed25519. Choose a passphrase for an interactive user's private key. Register only dev_vm.pub for the intended OS account, for example through instance provisioning or the account's ~/.ssh/authorized_keys file. After verifying the server's host key against a trusted source, test the login with ssh -i ~/.ssh/dev_vm devuser@dev.example.com. Keep an existing session or recovery path available when changing authentication settings so a configuration mistake does not lock out administrators.
In the cloud, a provisioning system may install a key at instance creation, or an identity-aware access service may make a key available to the server for a short time. Neither approach makes the SSH endpoint reachable or grants OS permissions by itself: the connection still needs an allowed network path, and the authenticated account still needs the right permissions. If login fails, check the target username, which key the client is offering, and the server's key source, file permissions, and authentication logs. A key shown in a cloud console is not necessarily the key the guest OS currently accepts.
For a larger fleet, an SSH certificate authority can sign a developer's public key to issue a short-lived OpenSSH user certificate. Configure servers to trust the CA and accept only the appropriate certificate principals for each account. The client still proves possession of the matching private key; the certificate tells the server which identities the CA approved and for how long. An SSH user certificate is not a TLS certificate. Certificates reduce per-host key distribution, but they require a protected CA signing key and a reliable issuance process.
Static keys are easy to deploy on a few hosts, but rotation and offboarding require removing trust everywhere the old key was authorized. Deleting the local private-key file does not revoke copies. Use separate credentials for people and automation, keep private keys out of repositories and VM images, and remove authorization promptly if a key is exposed. A passphrase protects a stored private-key file; by itself it is not a second factor verified by the server. Client authentication is also separate from host verification and transport encryption: the host key identifies the server, and SSH uses session keys to encrypt traffic.