Skip to content

Commit 48e1d39

Browse files
authored
add aws cli v2 command for importing key pair command (#115)
* add aws cli v2 command for importing key pair command * Update ec2.mdx
1 parent 381ab6b commit 48e1d39

File tree

1 file changed

+1
-1
lines changed
  • src/content/docs/aws/services

1 file changed

+1
-1
lines changed

src/content/docs/aws/services/ec2.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ icacls.exe key.pem /inheritance:r
6969
If you already have an SSH public key that you wish to use, such as the one located in your home directory at `~/.ssh/id_rsa.pub`, you can import it instead.
7070

7171
```bash
72-
awslocal ec2 import-key-pair --key-name my-key --public-key-material file://~/.ssh/id_rsa.pub
72+
awslocal ec2 import-key-pair --key-name my-key --public-key-material "$(cat ~/.ssh/id_rsa.pub)"
7373
```
7474

7575
If you only have the SSH private key, a public key can be generated using the following command, and then imported:

0 commit comments

Comments
 (0)