Skip to main content

Interactive CLI to connect to AWS EC2 and RDS via SSM or SSH-over-SSM, with credential persistence and multi-session support.

Project description

ssm-connect

Interactive CLI to connect to AWS EC2 instances and RDS databases via:

  • SSM Session Manager (interactive shell)
  • SSH over SSM (with your SSH key)
  • RDS Port Forwarding (via EC2 bastion host)

Multiple sessions in parallel (each opens in a new terminal). Keyword search across Name, Instance ID, and all tag values. Simple, cross-platform, and secure-by-default.

Features

  • Target Selection: Choose to connect to EC2 instances or RDS databases
  • EC2 Connections:
    • SSM Session Manager (interactive shell)
    • SSH over SSM (with private key authentication)
  • RDS Connections:
    • Port forwarding to RDS databases via EC2 bastion host
    • Auto-selects available local port
  • Smart Search: Filter instances by keywords (matches Name, InstanceId, and all tag values)
  • Multi-Session: Opens each connection in a new terminal window (Linux, macOS, Windows) allowing for multiple simultaneous sessions.
  • AWS Session: Automatically inherits AWS credentials
  • Security: All code undergoes automated CodeQL static analysis on every PR and merge

Install

Latest release from PyPI: pip install --upgrade ssm-connect

Run the tool: ssm-connect

Requirements

  • User should already be logged in to AWS
  • AWS CLI v2
  • SSM Session Manager plugin (installation guide)
  • OpenSSH client (ssh command) - for SSH over SSM
  • Python 3.8+
  • Appropriate IAM role

Terminal Apps

The tool automatically detects and uses available terminal emulators:

  • Windows: Windows Terminal (wt), PowerShell, or cmd
  • macOS: Terminal.app
  • Linux: gnome-terminal, konsole, xterm, or x-terminal-emulator

Usage

Start the CLI: ssm-connect

Connection Flow

  1. Choose Target Type:

    • [1] EC2 - Connect directly to an EC2 instance
    • [2] RDS - Forward port to an RDS database via bastion
  2. For EC2 Connections:

    • Choose connection type:
      • [1] SSM - Interactive shell via Session Manager
      • [2] SSH over SSM - SSH session with your private key
    • Filter and select target EC2 instance
    • For SSH: Provide private key path and username
  3. For RDS Connections:

    • Step 1: Select EC2 bastion instance (must have SSM access)
    • Step 2: Select target RDS database
    • Connect to localhost:[auto-selected-port] with your database client

Troubleshooting

Command not found

Ensure aws, session-manager-plugin, and ssh are installed and on PATH.

SSO expired

Refresh your AWS SSO session: aws sso login --profile your-profile

SSH key errors

Ensure the key exists and has proper permissions

No terminal found (Linux)

Install a terminal emulator

RDS connection refused

Ensure:

  • The bastion EC2 instance has network connectivity to the RDS
  • The bastion is running
  • You have the appropriate role

Uninstall

pip uninstall ssm-connect

Security

Static Code Analysis

All pull requests and merges undergo automated CodeQL security analysis to detect:

  • Security vulnerabilities
  • Code quality issues
  • Potential bugs
  • Unsafe coding patterns

Reporting Security Issues

If you discover a security vulnerability, please report it privately via GitHub's Security Advisory feature rather than opening a public issue.

Contributing

Issues and pull requests are welcome. Please keep changes focused and include brief notes if behavior changes.

License

Apache License 2.0. See LICENSE 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

ssm_connect-1.1.0.tar.gz (15.0 kB view details)

Uploaded Source

Built Distribution

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

ssm_connect-1.1.0-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file ssm_connect-1.1.0.tar.gz.

File metadata

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

File hashes

Hashes for ssm_connect-1.1.0.tar.gz
Algorithm Hash digest
SHA256 02fff1ed23d5b2c43baec6cd3baeb97c050b73eead0dbcec3dc2433e7ae4c74d
MD5 c444dd7a63888e571f127a28415e994f
BLAKE2b-256 e1d3004286ed1712e7a8cb9337ee281633022e25169bf7dc815f84ae68b114ec

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssm_connect-1.1.0.tar.gz:

Publisher: publish.yml on JoseSiby/ssm-connect

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

File details

Details for the file ssm_connect-1.1.0-py3-none-any.whl.

File metadata

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

File hashes

Hashes for ssm_connect-1.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b647d16f5c360fa95878c44ddf3dbee9502a1b5431dfed34d574342175e127e7
MD5 8b97777bfb12768109d85d8b4a64a7fe
BLAKE2b-256 d3ab41d6be522a50f010f81e35ad39dec38abb7a0ce46612bd316162477d3228

See more details on using hashes here.

Provenance

The following attestation bundles were made for ssm_connect-1.1.0-py3-none-any.whl:

Publisher: publish.yml on JoseSiby/ssm-connect

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