create SSH key pairs
SSH Keys and Public Key Authentication
The SSH protocol uses public key cryptography for authenticating hosts and users. The authentication keys, called SSH keys, are created using the keygen
program.
SSH introduced public key authentication as a more secure alternative to the older .rhosts
authentication. It improved security by avoiding the need to have password stored in files, and eliminated the possibility of a compromised server stealing the user's password.
However, SSH keys are authentication credentials just like passwords. Thus, they must be managed somewhat analogously to user names and passwords. They should have a proper termination process so that keys are removed when no longer needed.
How to generate SSH key pairs and authen
authorized keys file
The authorized_keys
file in SSH specifies the SSH keys that can be used for logging into the user account for which the file is configured. It is a highly important configuration file, as it configures permanent access using SSH keys and needs proper management.
Once you add a public key under a specific user, the file "authorized keys" will be created in ~/.ssh/, or when more public keys are created under the same linux user, more public keys will be added to the "authorized keys" file.
to read all authorized public keys, added on a "specific user" use the following command cat ~/.ssh/authorized_keys
(remote host)
Last updated
Was this helpful?