Skip to content

Instantly share code, notes, and snippets.

@91pavan
Created July 6, 2019 19:24
Show Gist options
  • Save 91pavan/7fe3171aa5da2fc712990b10c751b63b to your computer and use it in GitHub Desktop.
Save 91pavan/7fe3171aa5da2fc712990b10c751b63b to your computer and use it in GitHub Desktop.
How to create a pem file from scratch for a linux target machine
ssh-keygen -f identifier -m PEM -t rsa # execute on your laptop
ssh-copy-id -i identifier.pub ubuntu@target_machine # copy the .pub file to target machine
mv identifier identifer.pem # change name to .pem
chmod 600 identifier.pem # change permissions
ssh -i identifer.pem ubuntu@target_machine # ssh using the new created pem file
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment