Skip to content

Latest commit

 

History

History
14 lines (11 loc) · 343 Bytes

how-to-generate-public-ssh-key-from-private-ssh-key.md

File metadata and controls

14 lines (11 loc) · 343 Bytes

How to generate a public SSH key from private SSH key

PRIVATE_KEY=~/.ssh/id_rsa
ssh-keygen -y -f $PRIVATE_KEY > $PRIVATE_KEY.pub

To do it in batch for a bunch of .pem files:

sudo apt-get update
sudo apt-get install -y ssh-askpass
find . -name "*.pem" | while read -r key; do ssh-keygen -y -f $key > $key.pub; done