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)
- File Transfer (SCP) (Securely upload/download files)
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)
- SSH ProxyJump (Connect to target host via bastion)
- RDS Connections:
- Port forwarding to RDS databases via EC2 bastion host
- Auto-selects available local port
- File Transfer:
- Upload/Download files to/from EC2 instances using SCP
- Uses existing SSH key configuration
- 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: Automated scanning via CodeQL, Gitleaks and Pip-Audit on every PR
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 (
sshcommand) - for SSH over SSM - Python 3.8+
- Appropriate IAM role
- SSH Agent (optional but recommended): Ensure
ssh-agentis running to avoid repeated passphrase prompts.
Terminal Apps
The tool automatically detects and uses available terminal emulators:
- Windows: Windows Terminal (
wt), PowerShell, orcmd - macOS: Terminal.app
- Linux:
gnome-terminal,konsole,xterm, orx-terminal-emulator
Usage
Start the CLI: ssm-connect
Connection Flow
-
Choose Target Type:
[1] EC2- Connect directly to an EC2 instance[2] RDS- Forward port to an RDS database via bastion[3] File Transfer- Securely upload/download files[4] Favorites- Quick connect to saved aliases
-
For EC2 Connections:
- Choose connection type:
[1] SSM- Interactive shell via Session Manager[2] SSH over SSM- SSH session with your private key[3] SSH ProxyJump- Connect to remote host via this instance
- Filter and select target EC2 instance
- For SSH: Provide private key path and username
- Choose connection type:
-
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
-
For File Transfer (SCP):
- Select remote instance
- Choose direction (Upload / Download)
- Specify local and remote file paths
- Tool handles the secure copy tunneling
-
Favorites & Aliases:
- Save: After any connection, answer
yto "Save this connection as a favorite?" - Connect:
- Select
[4] Favoritesfrom menu, OR - Use CLI:
ssm-connect -f <alias>(e.g.,ssm-connect -f prod-db)
- Select
- Save: After any connection, answer
Alternate Execution
If you cannot modify your PATH or access the Scripts folder, you can run the tool as a Python module:
python -m ssm_connect
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
Automated Security Checks
All pull requests and merges undergo automated security analysis to ensure code quality and safety:
- CodeQL: Static code analysis for security vulnerabilities and unsafe coding patterns.
- Gitleaks: Scans for hardcoded secrets and credentials to prevent leaks.
- Pip-Audit: Scans Python dependencies for known security vulnerabilities.
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
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 ssm_connect-1.4.1.tar.gz.
File metadata
- Download URL: ssm_connect-1.4.1.tar.gz
- Upload date:
- Size: 21.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
36943de838a7514e2d0422470fba31f99665d1ff1bfac81a2699a25d06d560c3
|
|
| MD5 |
d3db97542120e1f26655e9b26ffd5b3d
|
|
| BLAKE2b-256 |
80d5d81b27a9e84c256442706012dcae2533cc788c7568dfebefd5009a0372dc
|
Provenance
The following attestation bundles were made for ssm_connect-1.4.1.tar.gz:
Publisher:
publish.yml on JoseSiby/ssm-connect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ssm_connect-1.4.1.tar.gz -
Subject digest:
36943de838a7514e2d0422470fba31f99665d1ff1bfac81a2699a25d06d560c3 - Sigstore transparency entry: 814902269
- Sigstore integration time:
-
Permalink:
JoseSiby/ssm-connect@f879d175e69ddfb0d7ec6500cf8f4da4f1982024 -
Branch / Tag:
refs/tags/v1.4.1 - Owner: https://github.com/JoseSiby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f879d175e69ddfb0d7ec6500cf8f4da4f1982024 -
Trigger Event:
release
-
Statement type:
File details
Details for the file ssm_connect-1.4.1-py3-none-any.whl.
File metadata
- Download URL: ssm_connect-1.4.1-py3-none-any.whl
- Upload date:
- Size: 20.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5b4032e89ecbd7706d5074ba586b88e90c31b8cc5cda1039c313df4d1c4c0602
|
|
| MD5 |
d32721c02202766277a0adf94b7611e9
|
|
| BLAKE2b-256 |
4efd8e0355e65234484d30fd9978aaf101d4ffceef2e47de57ba5307fcb39d16
|
Provenance
The following attestation bundles were made for ssm_connect-1.4.1-py3-none-any.whl:
Publisher:
publish.yml on JoseSiby/ssm-connect
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
ssm_connect-1.4.1-py3-none-any.whl -
Subject digest:
5b4032e89ecbd7706d5074ba586b88e90c31b8cc5cda1039c313df4d1c4c0602 - Sigstore transparency entry: 814902274
- Sigstore integration time:
-
Permalink:
JoseSiby/ssm-connect@f879d175e69ddfb0d7ec6500cf8f4da4f1982024 -
Branch / Tag:
refs/tags/v1.4.1 - Owner: https://github.com/JoseSiby
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@f879d175e69ddfb0d7ec6500cf8f4da4f1982024 -
Trigger Event:
release
-
Statement type: