If you use SSH related commands, the Linux system will generate some files regarding the keys. Usually you see a hidden directory “.ssh” inside the user’s home directory.
Also, you see a file ~/.ssh/authorized_keys
This file is used by SSH authentication. The file content stores public keys which come from client machines. (Client machine keeps the private key and the server keeps the public key.)
When client machines would like to connect into the server using SSH protocol, SSH program checks if the incoming request matchs the public keys in ~/.ssh/authorized_keys
Only connections with matched key pairs can access the server without prompting for login credential.