What Is ssh-keygen?

ssh-keygen is a tool for creating new SSH public-key key pairs.

SSH Keys and Public Key Authentication

The SSH protocol uses public-key cryptography to authenticate hosts and users.

SSH introduced public key authentication as a more secure alternative to the older .rhosts authentication. It improved security by avoiding the need to have a password stored in files, and eliminated the possibility of a compromised server stealing the user's password.