Skip to content

Latest commit

 

History

History
27 lines (21 loc) · 652 Bytes

ec2-instance-with-cfinit.md

File metadata and controls

27 lines (21 loc) · 652 Bytes

Optional: Ensure you are using the right credentials

aws sts get-caller-identity

Result:

{
    "Account": "5737836549463", 
    "UserId": "AIDHGDGKSHGJGHFJKGFHJNF", 
    "Arn": "arn:aws:iam::5737836549463:user/yourusername"
}
  1. Create EC2 Key pair
aws ec2 create-key-pair --key-name EC2KeyPair-yourusername > ~/.ssh/EC2KeyPair-yourusername.pem

chmod 400 ~/.ssh/EC2KeyPair-yourusername.pem

Original permissions: -rw-r--r-- New permissions: -r--------

Note: You can check the permissions executing: ls -la ~/.ssh/EC2KeyPair-yourusername.pem