generate private key using openssl code example
Example 1: generate key and certificate openssl
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -days 365
Example 2: create public key from private
chmod 400 ~/.ssh/id_rsa
ssh-keygen -y -f ~/.ssh/id_rsa > ~/.ssh/id_rsa.pub