How SSH key works with a remote machineHow SSH key works with a remote machine
The remote machine (the server you are connecting to) contains the public key in the ~/.ssh/authorized_keys file. This file contains a list of public keys that are authorized to connect