Skip to content

Instantly share code, notes, and snippets.

@josephgoksu
Last active April 27, 2022 12:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save josephgoksu/07e02fde8f14e77282f6c4c2cc84efad to your computer and use it in GitHub Desktop.
Save josephgoksu/07e02fde8f14e77282f6c4c2cc84efad to your computer and use it in GitHub Desktop.

RSA 2048 Key-Pair Generation

Generate Private Key

openssl genrsa -out mykey.pem 2048

Generate Public key using Private Key

openssl rsa -in mykey.pem -pubout > mykey.pub


File Permission

chmod 400 mykey.pem

To get a usable public key for SSH purposes (eg AWS EC2)

ssh-keygen -y -f key.pem > key.pub

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