Skip to content

Commit

Permalink
Update docs for ec2 connect
Browse files Browse the repository at this point in the history
update Dockerfile to 1.16
  • Loading branch information
Eugene Dementyev authored and ekini committed Jul 20, 2021
1 parent d892194 commit a389809
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.13-alpine as build
FROM golang:1.16-alpine as build

RUN apk update && apk add git

Expand Down
22 changes: 20 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### What it is
### aws-ssh is your swiss knife for SSH into AWS instances

This program goes through all available AWS accounts in parallel and determines

Expand All @@ -11,7 +11,23 @@ There are the following EC2 instance tags that change behaviour:
3. "x-aws-ssh-user" - sets the ssh username in the config.
4. "x-aws-ssh-port" - sets the ssh port in the config.

Any comments and especially pull requests are highly appreciated.
### Utilise ec2 connect feature

If your AWS EC2 instances are set up for ec2 connect and your AWS user has appropriate IAM policies, aws-ssh can connect to the instance straight away.

There are certain prerequisites:

1. Check `--ssh-config-path` option of "aws-ssh connect". aws-ssh will generate an config for SSH under this path, which will have the instance IP address, user to log under and even config for the bastion hosts. This file will be rewritted on every run of aws-ssh
2. Include the above file into your ssh config using `Include ec2_connect_config` where `ec2_connect_config` is the filename (or path) as above.
3. You can specify AWS profile from your config using `-p` flag and the instance id using `-i` flag.
4. But it's boring to look up the instance id every time so you can run `aws-ssh update` to generate cache of all EC2 instances across all available AWS profiles
5. Then just run `aws-ssh connect` to search for the right instance and press "Enter"

### Utilise reconf feature

Instead of using EC2 connect, one can have their ssh keys directly on the instances, so for those cases there is `aws-ssh reconf` command which just generates ssh config to be included in the main one.

### Basic usage

```
Usage:
Expand Down Expand Up @@ -43,6 +59,8 @@ For example:
2. `AWS_SSH_NO_PROFILE_PREFIX` is `--no-profile-prefix`,
3. etc...

Basically, take any flag, add `AWS_SSH_` prefix, uppercase it and replace "-" with "\_".

### Build

You'll need go>=1.16. Note that this project uses `go.mod`, so the project has to be cloned somewhere outside of the `GOPATH` directory.
Expand Down

0 comments on commit a389809

Please sign in to comment.