Skip to content

Latest commit

 

History

History
34 lines (28 loc) · 716 Bytes

manage-ec2-keypairs-aws-cli.md

File metadata and controls

34 lines (28 loc) · 716 Bytes
aliases category classification date date_modified draft id image links local_archive_links pinned print series tags title type
manage-ec2-keypairs-aws-cli
aws
public
2020-08-26 08:25:49 -0700
2020-08-26 08:25:49 -0700
false
20200826152549
false
false
aws
cli
ssh
keys
ec2
Manage EC2 KeyPairs with the AWS CLI
tech-note

Create a Key Pair

The below will create a keypair and save it to your SSH folder.

aws ec2 create-key-pair --profile "<profile>" --region "<region>" --query "KeyMaterial" --output "text" --key-name "<key_name>" > ~/.ssh/<key_name>

Delete a Key Pair

aws ec2 create-key-pair --profile "<profile>" --region "<region>" --key-name "<key_name>"