Wednesday, October 14, 2015

Generating a public key for SSH using your private RSA key

In order to ssh onto a server using public private key pairs, you need a specific type of public key. If you have the private key you can generate the public to install into the ~/.ssh/authorized_keys file with the following

echo "actual private key data" > private
chmod 600 private
ssh-keygen -y -f private

You can generate a public key with the following

 openssl rsa -in private.pem -pubout > public

But it won't work for using ssh e.g. ssh -i private

No comments: