Skip to content

Instantly share code, notes, and snippets.

@li0nel
Last active December 10, 2017 17:19
Show Gist options
  • Save li0nel/7a8fc21e80a3d2b14065ed7aa53f4d13 to your computer and use it in GitHub Desktop.
Save li0nel/7a8fc21e80a3d2b14065ed7aa53f4d13 to your computer and use it in GitHub Desktop.
Create an EC2 key pair to be installed on your EC2 instances
# Create the key pair and extract the private key from the JSON response
aws ec2 create-key-pair
--key-name=laravelaws
--query 'KeyMaterial'
--output text > laravelaws.pem
# Assign appropriate permissions to the key file for it to be usable
chmod 400 laravelaws.pem
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment