How to extract the public key from a .pem certificate for use with openssh

-1

I have a rsa private key formatted as PEM issued by the Amazon Key Generation Service (AWS). I need to extract the public key, from the private key to use in the ~/.ssh/authorized_keys file in other instances.

How do I extract the public key having the private key?

    
asked by anonymous 10.12.2018 / 17:49

1 answer

0

To extract the public key, use the command ssh-keygen as below:

ssh-keygen -f chave_privada.pem -y > chave_publica.pub
    
10.12.2018 / 17:49