generate public key code example
Example 1: create a ssh key
ssh-keygen -t rsa -C "[email protected]"
Example 2: create public key from private
chmod 400 ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub
Example 3: get public key from certificate
openssl x509 -inform der -in certificate.der -pubkey -noout > public_key.pem
Example 4: how to generate my RSA key pair
myLocalHost% ssh-keygen
Generating public/private rsa key pair.
Enter file in which to save the key(/home/johndoe/.ssh/id_rsa):