Here's a quick post explaining how you can SSH into a remote machine without using a password.
Spoiler: Yes, it is of course using a public key.
First generate a pair of authentication keys on your laptop.
ssh-keygen -t rsa
Then copy the public key generated in the previous step, located at
/home/ubuntu/.ssh/authorized_keys of your remote machine.
Once done, you can log into the remote machine directly without a password.
In case of
ubuntu user, you'd use: