Skip to main content

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, persistent history, and saved command favorites
  • 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/credentials and ~/.aws/config)
  • SSH client (standard on Linux/macOS, OpenSSH on Windows)
  • pipx for 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 Ctrl+R Command picker (saved + recent)
Command Overlay Ctrl+S Save command to favorites
Command Overlay Up/Down Command history

What You Can Do

  1. List Instances — View all EC2 instances with search/filter
  2. Search — Filter instances by name, type, region, or state; search scan results
  3. Manage SSH Keys — Configure default and per-instance SSH keys
  4. Scan Servers — Run keyword scans across running instances
  5. Settings — Configure connection profiles, scan rules, preferences

When you select a server: browse files, run commands, SSH connect, SCP transfer, or view scan results. Command history persists across sessions — use Ctrl+R to search history and saved commands, Ctrl+S to save favorites.

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ec2_tui-2.1.0.tar.gz (76.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ec2_tui-2.1.0-py3-none-any.whl (76.6 kB view details)

Uploaded Python 3

File details

Details for the file ec2_tui-2.1.0.tar.gz.

File metadata

  • Download URL: ec2_tui-2.1.0.tar.gz
  • Upload date:
  • Size: 76.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ec2_tui-2.1.0.tar.gz
Algorithm Hash digest
SHA256 9a9be5bacc517b0712d2b3299cbc0d946c711013ed2ce800e27f25653224049c
MD5 6f7be20d3015f45a647601abd7707c58
BLAKE2b-256 45f954646cfb02a30d8ba2e55ad54d4f17f31745fb3231aa81a0a7a1571f8806

See more details on using hashes here.

Provenance

The following attestation bundles were made for ec2_tui-2.1.0.tar.gz:

Publisher: publish.yml on zb-ss/ec2-ssh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file ec2_tui-2.1.0-py3-none-any.whl.

File metadata

  • Download URL: ec2_tui-2.1.0-py3-none-any.whl
  • Upload date:
  • Size: 76.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for ec2_tui-2.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 70d5831d3cca0f1637d329bb082f2b4791e34fe029a4b408f815b1c14519ae43
MD5 2da22ee46e996f258168ec2822f340c3
BLAKE2b-256 c41c4088b650d05d02b9479cdc5a11a520867fbcc251ecb0af288c71bb68afe5

See more details on using hashes here.

Provenance

The following attestation bundles were made for ec2_tui-2.1.0-py3-none-any.whl:

Publisher: publish.yml on zb-ss/ec2-ssh

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page