From tecmint.com
SSH (Secure SHELL) is one of the most used network protocols to connect and login to remote Linux servers, due to its increased security provided by its cryptographic secure channel established for data flow over insecure networks and its Public Key Authentication.
While using SSH passwords to log in to remote Linux servers can provide less secure system security because a password can be brute-force cracked.
SSH Public Key Authentication provides the best secure method to perform distance logins, because it’s almost impossible to decipher the key, and the private key guarantees that the sender it’s always who it claims to be.