SSM — like SSH, but through AWS Systems Manager. Auto Duo SSO re-login, auto root escalation, port forwarding, tunneling, and multi-host run.
Project description
cisco-ssm
SSM — like SSH, but through AWS Systems Manager.
Drop-in replacement for SSH when connecting to EC2 instances via AWS SSM. Just type ssm <hostname> and you're in — with auto Duo SSO re-login, automatic root escalation, port forwarding, tunneling, and multi-host command execution.
Install
pip install cisco-ssm
Prerequisites: AWS CLI v2 and the Session Manager plugin must be installed.
Usage
After installing, the ssm command is available globally:
# Interactive shell (auto-escalates to root)
ssm myserver
ssm myserver@use1 # shell in us-east-1
# Run a command (SSH-style)
ssm myserver -- uname -a
ssm myserver -c "uname -a"
# Port forward (like ssh -L)
ssm myserver -L 8080 # same local & remote port
ssm myserver -L 8080:3000 # local 8080 → remote 3000
# Tunnel via jump EC2 to private services (RDS, OpenSearch, etc.)
ssm myserver -L 9443:rds.host:443
# Multi-host run
ssm h1 h2 h3 -c "uptime"
ssm -f hosts.txt -c "df -h"
# Disable auto root escalation
ssm myserver --no-sudo
Identifiers
The TARGET can be any of:
- EC2 Name tag (e.g.
myserver) - FQDN (e.g.
myserver.example.com) - Private or public IP (e.g.
172.22.6.230) - Instance ID (e.g.
i-0623d1bb65aecbb84)
Features
- SSH-like simplicity —
ssm hostand you're connected - Auto Duo SSO re-login — expired token? The script runs
duo-ssofor you automatically - Auto root escalation —
sudo su -is sent automatically after the shell prompt appears (disable with--no-sudo) - Read-only mode detection — automatically uses the read-only SSM document when your Duo role is read-only
- Region shortcuts —
ssm host@use1for us-east-1,@euw1for eu-west-1,@aps1for ap-southeast-1 - Port forwarding — SSH-style
-Lflag for direct and tunnel forwarding - Multi-host run — run commands across many servers with batched resolution and SSM Online filtering
- Spinner + colors — clean, informative terminal output
Environment Variables
| Variable | Description | Default |
|---|---|---|
AWS_REGION |
Default AWS region | us-east-1 |
SSM_MODE |
Force mode: readonly, devops, admin |
auto-detected |
SSM_DUO_CMD |
Duo SSO re-login command | duo-sso --session-duration 3600 |
SSM_TIMEOUT_SECONDS |
Run command timeout | 3600 |
License
Apache 2.0
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 cisco_ssm-1.0.0.tar.gz.
File metadata
- Download URL: cisco_ssm-1.0.0.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0286a76005472a5198f1ad19c44927b887cedafcaefbf41d8108ee16eded08c4
|
|
| MD5 |
24dce1001c976c82b848042264184d25
|
|
| BLAKE2b-256 |
1ad9da155fa6e9d8a56aa1d4b78a111a2499fe96f18c91fa2be0cf161eebb827
|
File details
Details for the file cisco_ssm-1.0.0-py3-none-any.whl.
File metadata
- Download URL: cisco_ssm-1.0.0-py3-none-any.whl
- Upload date:
- Size: 16.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.9.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
7396903572dc160deaa9ce5c5241d39013bd30c1614077e3e0cf31bbeef23086
|
|
| MD5 |
779d6ba68fd86a4747950dfc4dc49c39
|
|
| BLAKE2b-256 |
991bd0cc6fe11b5cb612cdd33fee52f5193a643ffbc98e533625efd1b622056e
|