Skip to content

Instantly share code, notes, and snippets.

@valter-jnr
valter-jnr / git_push_to_remote_with_pem_auth.sh
Created April 24, 2017 20:40 — forked from roalcantara/git_push_to_remote_with_pem_auth.sh
Git push to remote with pem authentication
# generate public/private keys using ssh-keygen
ssh-keygen -t rsa
# change the permissions of the .pem file so only the root user can read it
chmod 400 amazon-generated-key.pem
# copy the machine to the remote repository
ssh-copy-id -i ~/.ssh/id_rsa.pub amazon-generated-key.pem ec2-user@amazon-instance-public-dns
# or