Interactive TUI for managing AWS EC2 SSH connections
Project description
EC2 Connect
A modern Terminal User Interface (TUI) for managing AWS EC2 instances — list, search, SSH, SCP, and scan servers across all regions.
Quick Install
Linux / macOS:
curl -sSL https://raw.githubusercontent.com/zb-ss/ec2-ssh/master/install.sh | bash
Windows (PowerShell):
irm https://raw.githubusercontent.com/zb-ss/ec2-ssh/master/install.ps1 | iex
Or install directly via pipx / pip:
pipx install ec2-tui
Manual install from source:
git clone https://github.com/zb-ss/ec2-ssh.git
cd ec2-ssh
pipx install .
Features
- Interactive TUI with mouse and keyboard support powered by Textual
- List and search EC2 instances across all AWS regions
- SSH into instances — launches in new terminal window with auto-detected emulator
- Run remote commands via overlay panel with real-time streaming output
- Browse remote file systems — interactive file tree navigation
- SCP file transfer — upload/download files and directories
- Keyword-based server scanning — search file contents across instances
- Bastion host / jump server support via ProxyJump or ProxyCommand
- SSH key management with auto-discovery and per-instance configuration
- Instance caching with stale-while-revalidate for fast startup
- Fully configurable — all settings in
~/.ec2_ssh_config.json
Prerequisites
- Python 3.8+
- AWS CLI configured (
~/.aws/credentialsand~/.aws/config) - SSH client (standard on Linux/macOS, OpenSSH on Windows)
pipxfor isolated installation (recommended)
Your AWS credentials need ec2:DescribeInstances and ec2:DescribeRegions permissions.
Usage
ec2-ssh # Launch the TUI
ec2-ssh --debug # Launch with debug logging to stderr
Keyboard Shortcuts
| Context | Key | Action |
|---|---|---|
| Global | Q |
Quit |
| Global | ? |
Help screen |
| Global | Escape |
Go back / close |
| Instance List | / |
Focus search |
| Instance List | R |
Force-refresh from AWS |
| Instance List | S |
SSH to selected instance |
| Instance List | B |
Browse remote files |
| Instance List | C |
Run command overlay |
| Instance List | T |
SCP transfer |
| Command Overlay | Ctrl+C |
Stop running command |
| Command Overlay | Up/Down |
Command history |
What You Can Do
- List Instances — View all EC2 instances with search/filter
- Search — Filter instances by name, type, region, or state; search scan results
- Manage SSH Keys — Configure default and per-instance SSH keys
- Scan Servers — Run keyword scans across running instances
- Settings — Configure connection profiles, scan rules, preferences
When you select a server: browse files, run commands, SSH connect, SCP transfer, or view scan results.
Instance Caching
| Scenario | Behavior |
|---|---|
| First launch (no cache) | Fetches from AWS with progress indicator |
| Restart within TTL (default 1h) | Instant load from cache |
| Restart after TTL | Shows stale data immediately, refreshes in background |
Press R |
Force-refresh from AWS |
Configuration
All configuration lives in ~/.ec2_ssh_config.json, created automatically on first run.
See Configuration Guide for the full reference including connection profiles, scan rules, and match conditions.
Development
# Run directly (primary dev workflow)
PYTHONPATH=src python3 -m ec2_ssh.main
# Run with debug logging
PYTHONPATH=src python3 -m ec2_ssh.main --debug
# Install editable
pip install -e .
# Update pipx installation after changes
pipx install . --force
# Run tests
pip install -e ".[test]"
pytest
See Architecture for codebase structure and design patterns.
Troubleshooting
See Troubleshooting Guide for help with SSH connections, bastion hosts, key management, and AWS credentials.
Logging
Logs are always written to ~/.ec2_ssh_logs/ec2_ssh.log. Use --debug for verbose stderr output.
When SSH fails, the terminal window stays open showing the error and exit code.
License
This project is licensed under the MIT License — see the LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file ec2_tui-2.0.0.tar.gz.
File metadata
- Download URL: ec2_tui-2.0.0.tar.gz
- Upload date:
- Size: 71.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b485e15e5f90ada41a91c75becb874f78e1cdf2e7700c9b3a321f7db731c2668
|
|
| MD5 |
824b82f1ed4c074dd4e4147ba7b87335
|
|
| BLAKE2b-256 |
235c1ff712fd5e8a12178351c9d182c89a5a2b2b2089f7b89133e610475f4052
|
File details
Details for the file ec2_tui-2.0.0-py3-none-any.whl.
File metadata
- Download URL: ec2_tui-2.0.0-py3-none-any.whl
- Upload date:
- Size: 71.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e99e56942f1bb0ad48c6ccd10d8144743ac63a8b4d2f12fb7cf87e3a258cc763
|
|
| MD5 |
4237102aa073fd1f9f18ac6e97e2e850
|
|
| BLAKE2b-256 |
ecc1f64d628d5c41ba22fd0057d1f584f42b0ae8745c53fd6ed12167fda67c20
|