get public ssh key
ssh-keygen cat ~/.ssh/id_rsa.pub
what is role of public key in ssh
A public key that is copied to the SSH server(s). Anyone with a copy of the public key can encrypt data which can then only be read by the person who holds the corresponding private key.