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

supratim_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.

supratim_ssm-1.0.0-py3-none-any.whl (16.3 kB view details)

Uploaded Python 3

File details

Details for the file supratim_ssm-1.0.0.tar.gz.

File metadata

  • Download URL: supratim_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 supratim_ssm-1.0.0.tar.gz
Algorithm Hash digest
SHA256 34296a8cfc678f0617353f8dbc0aea439ccdde41af6ece2c9e11ad57d510c0d2
MD5 d1b21a2991ffbd9f13754a694b500737
BLAKE2b-256 af4b08e663a74b5a45f1667fbdebbd94467e2a712a8d60556c1e0aa2de269025

See more details on using hashes here.

File details

Details for the file supratim_ssm-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: supratim_ssm-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 16.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for supratim_ssm-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e96fdbe4d3dbe64c0bb8979a9db4236b765c8dc8eeb4e7c1396ccde9b4ea46e2
MD5 adbccb21f73d065f8870150bdb2b62aa
BLAKE2b-256 3b73de5d689f1ee886ae3147ff698d2746d4593454750c06c44fff3626799755

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