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