Skip to main content

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 simplicityssm host and you're connected
  • Auto Duo SSO re-login — expired token? The script runs duo-sso for you automatically
  • Auto root escalationsudo 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 shortcutsssm host@use1 for us-east-1, @euw1 for eu-west-1, @aps1 for ap-southeast-1
  • Port forwarding — SSH-style -L flag 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


Download files

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

Source Distribution

cisco_ssm-1.0.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.

cisco_ssm-1.0.0-py3-none-any.whl (16.2 kB view details)

Uploaded Python 3

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

Hashes for cisco_ssm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 0286a76005472a5198f1ad19c44927b887cedafcaefbf41d8108ee16eded08c4
MD5 24dce1001c976c82b848042264184d25
BLAKE2b-256 1ad9da155fa6e9d8a56aa1d4b78a111a2499fe96f18c91fa2be0cf161eebb827

See more details on using hashes here.

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

Hashes for cisco_ssm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7396903572dc160deaa9ce5c5241d39013bd30c1614077e3e0cf31bbeef23086
MD5 779d6ba68fd86a4747950dfc4dc49c39
BLAKE2b-256 991bd0cc6fe11b5cb612cdd33fee52f5193a643ffbc98e533625efd1b622056e

See more details on using hashes here.

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