SSH uses public key cryptography to authenticate the remote computer and allow the remote computer to authenticate the user, if necessary. There are several ways to use SSH; one of them is to use the automatic public-private key pair to simply encrypt the network connection, and then use password authentication to login.