Find the public key belonging to a private key

Here’s how you can show the public key part if you have the private key.

$ ssh-keygen -y -f ~/.ssh/id_rsa

This’ll output your public key for SSH in the usual authorized_keys format.

$ ssh-keygen -y -f ~/.ssh/id_rsa
ssh-rsa AAAAB3....Twk5

Just in case you might need it one day!