Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

Interactive SSH for Ansible

Project description

Adds interactive SSH capabilities to Ansible, especially useful in setups with VMs in private subnets accessible only via jumphosts.


  • ansible
  • pip


Run with -h for command-line help:

usage: ansible-ssh [-h] [--inventory INVENTORY] [--key-file KEYFILE]
                   [--user USER] [--verbose] [--become]

positional arguments:
  host                  the host to ssh into, if not provided a list of hosts
                        in current inventory file is printed

optional arguments:
  -h, --help            show this help message and exit
  --inventory INVENTORY, -i INVENTORY
                        ansible inventory file to use instead of the one
                        defined in ansible.cfg
  --key-file KEYFILE, -k KEYFILE
                        ssh private key file to use instead of the default for
                        the user
  --user USER, -u USER, -l USER
                        override the user defined in ansible inventory file
  --verbose, -v         pass verbose flag to ssh command
  --become, -b          ssh as root instead of the inventory-supplied account


$ ansible-ssh lb-0
executing ssh -C -o ControlMaster=auto -o ControlPersist=60s -o ProxyCommand="ssh -W %h:%p -q ubuntu@" -l ubuntu
Last login: Sat May 25 15:40:13 2019 from

Project details

Download files

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

Files for ansible-ssh, version 0.5
Filename, size File type Python version Upload date Hashes
Filename, size ansible_ssh-0.5-py2-none-any.whl (4.6 kB) File type Wheel Python version py2 Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page