Skip to content

Instantly share code, notes, and snippets.

@hemanth415
Last active July 23, 2021 21:46
Show Gist options
  • Save hemanth415/bd5887ce9d32b636ec05abdd5897d686 to your computer and use it in GitHub Desktop.
Save hemanth415/bd5887ce9d32b636ec05abdd5897d686 to your computer and use it in GitHub Desktop.
ssh-keygen does not create RSA private key on MAC OS.

Private Key Format when using ssh-keygen -t rsa -b 4096 -f ~/.ssh/check

-----BEGIN OPENSSH PRIVATE KEY-----
b3BlbnNzaC1rZXktdjEAAAAACmFlczI1Ni1j
...
-----END OPENSSH PRIVATE KEY-----

This format is not accepted some of applications.

Command for generating Private Key in correct RSA Format ssh-keygen -m PEM -t rsa -b 4096 -f ~/.ssh/check

-----BEGIN RSA PRIVATE KEY-----
Proc-Type: 4,ENCRYPTED
DEK-Info: AES-128-CBC,1CD1F5D28E9D7ACD1334BA78B00E7646

oxfZCcieJ2T2gNTv1f1nRQVOc129VUr+MZEEUNE6LFVmuP6gTBVUmr6chiD4cfK7
...
-----END RSA PRIVATE KEY-----

Command for correcting the already generated Private Key to RSA Format ssh-keygen -p -m PEM -f ~/.ssh/check

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment