
During the authentication process, the public key is used to encrypt a random challenge message, which is then sent back to the authenticating client. The public key, however, is meant to be shared, and so it should be placed on the remote server that you’d like to access. The private key should remain private and secure, hence, not to be shared with anyone. SSH keys come in pairs made up of a private key and a public key. SSH itself can be used for a variety of use cases such as remote file transfer, network management and remote server access. SSH keys are access credentials that can be used during the authentication process for the secure shell (or SSH) network protocol.
