- Go 100%
| aws-icon.ico | ||
| config.md | ||
| config.yaml | ||
| connect.go | ||
| go.mod | ||
| go.sum | ||
| README.md | ||
| rsrc_windows_amd64.syso | ||
| secrets.go | ||
| secrets.yaml | ||
AWS EC2 SSH Connect
This program provides a streamlined way to connect to AWS EC2 instances via SSH, using a configuration-driven approach for automation and flexibility.
Features
- Connects to AWS EC2 instances using SSH
- Supports multiple server configurations via YAML
- Automates command execution upon connection
- Manages SSH key files for secure access
Usage
connect [options]
Options
-
-c, --config <string>
Location of configuration YAML file. -
-e, --exec <string>
Command to execute upon connection. If not provided, you will be prompted if multiple commands are available. -
-i, --ignore-cmd
Ignore command and connect only. -
-k, --keys <string>
Folder containing SSH key files. -
-s, --server <string>
Server label to use from configuration. If not provided, you will be prompted if multiple servers are available.
Examples
connect -c ./config.yaml -k ./keys -s my-server -e "uptime"
Connects to "my-server" as defined in ./config.yaml, and loading the key from ./keys and executes the "uptime" command as defined in the Yaml configuration
Configuration
See the config.md for configuration file description.
Secrets file
The secrets file should contain the key values encrypted by the app. You can do this using:
connect --encrypt ./secrets_plain.yaml > secrets.yaml
Example source (plain):
Server1: -----BEGIN RSA PRIVATE KEY----- <the actual plain key> -----END RSA PRIVATE KEY-----
Output (encrypted):
Server1: <long encrypted value>