Skip to content

Commit ce0fb4f

Browse files
authored
Update README.md
1 parent c1d0198 commit ce0fb4f

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ Open an SSH connection to your ec2 instances via AWS SSM without the need to ope
2222
* Move proxy command script [aws-ssm-ec2-proxy-command.sh](aws-ssm-ec2-proxy-command.sh) to `~/.ssh/aws-ssm-ec2-proxy-command.sh`
2323
* Ensure it is executable (`chmod +x ~/.ssh/aws-ssm-ec2-proxy-command.sh`)
2424

25-
##### Setup SSH Config
25+
###### Setup SSH Config [optional]
2626
* Add ssh config entry for aws ec2 instances to your `~/.ssh/config`. Adjust key file path if needed.
2727
```ssh-config
2828
host i-* mi-*
@@ -32,11 +32,12 @@ Open an SSH connection to your ec2 instances via AWS SSM without the need to ope
3232
```
3333

3434
#### Open SSH Connection
35-
* `ssh <INSTACEC_USER>@<INSTANCE_ID>`
36-
* Ensure AWS CLI environemnt variables are set properly
37-
* e.g. `AWS_PROFILE='default' ssh ec2-user@i-xxxxxxxxxxxxxxxx`
38-
* If default region does not match instance region you need to provide it like this
39-
* `AWS_PROFILE='default' ssh <INSTACEC_USER>@<INSTANCE_ID>--<INSTANCE_REGION>`
35+
* Ensure AWS CLI environemnt variables are set properly e.g. `export AWS_PROFILE=default` or `AWS_PROFILE=default ssh ... <INSTACEC_USER>@<INSTANCE_ID>`
36+
* If default region does not match instance region you need to provide it like this `<INSTACEC_USER>@<INSTANCE_ID>--<INSTANCE_REGION>`
37+
###### SSH Command with SSH Config Setup
38+
`ssh <INSTACEC_USER>@<INSTANCE_ID>`
39+
###### SSH Command with ProxyCommand CLI Option
40+
`ssh -o ProxyCommand="aws-ssm-ec2-proxy-command.sh %h %r %p ~/.ssh/id_rsa.pub" <INSTACEC_USER>@<INSTANCE_ID>`
4041

4142
## Alternative Implementation with `ec2-instance-connect`
4243
* Ensure [Prerequisits](#prerequisits)

0 commit comments

Comments
 (0)