Skip to main content

No project description provided

Project description

AWS EC2 SSH Utility

This is a command line utility to assist in connecting to EC2 via SSH using IAM and EC2 Instance Connect. It also allows connecting to private instances via a Bastion Host if you have one configured in your VPC. This currently only works on *nix command lines with the OpenSSH client installed at /usr/bin/ssh.

AWS Setup

Follow Amazon's documentation on setting up Instance Connect.

Installation

Install via you're favorite method for installing Python-based CLI tools: pip, pipenv, easy_install, etc. I recommend using pipenv, creating an environment just for this tool and then creating a symlink from the virtualenv bin directory to a directory on your PATH.

$ pipenv install -e git+https://github.com/goodwillaz/elastic-ssh\#egg=elastic-ssh
$ sudo ln -s `pipenv --venv`/bin/aws-ec2 /usr/local/bin/aws-ec2

Once you've installed the utility, you'll need to configure it. It uses AWS's Boto library which means it will look in the standard places for AWS Credentials. To configure the utility with an optional profile name (default is default):

$ aws-ec2 [--profile <profile>] configure

Note that the private key you are prompted for does not need to be the key-pair you used to create your EC2 instance. You can use any RSA based key-pair. The public key must sit in the same folder as the private key and have a .pub suffix to it.

Usage

Simply type aws-ec2 ssh on the command line; you'll be provided with a list of instances (and their names) for easy selection. Select the instance you'd like to connect to and you'll instantly be connected!

For help, simply run aws-ec2 --help or aws-ec2 <command> --help

Environment Variable Support

All of the command line flags can be specified as environment variables (if you need to):

  • AWS_EC2_DEBUG
  • AWS_EC2_PROFILE
  • AWS_EC2_SSH_USER
  • AWS_EC2_SSH_PORT
  • AWS_EC2_SSH_KEY
  • AWS_EC2_SSH_COMMAND

License

See the LICENSE file for license rights and limitations (BSD 3-clause).

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

elastic-ssh-0.1.1.tar.gz (6.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

elastic_ssh-0.1.1-py3-none-any.whl (10.3 kB view details)

Uploaded Python 3

File details

Details for the file elastic-ssh-0.1.1.tar.gz.

File metadata

  • Download URL: elastic-ssh-0.1.1.tar.gz
  • Upload date:
  • Size: 6.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.5.3

File hashes

Hashes for elastic-ssh-0.1.1.tar.gz
Algorithm Hash digest
SHA256 98781e1568cd83ad5fdd6b649691ea27bcf10b00569299e3771e339908c5ecb6
MD5 0311552dd9d7e05031612aac3fd438ce
BLAKE2b-256 83ed1015ad84602e6ae51eb9c579ef4427d0c7bf4220254dda23a1e9233481c5

See more details on using hashes here.

File details

Details for the file elastic_ssh-0.1.1-py3-none-any.whl.

File metadata

  • Download URL: elastic_ssh-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 10.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.15.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.6.0 requests-toolbelt/0.9.1 tqdm/4.47.0 CPython/3.5.3

File hashes

Hashes for elastic_ssh-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b0e4a9800ca0d07441bfd234c5673916e46cd6d85cd8d7cdb6e489943dd3c31f
MD5 4865777d7e25a9c2e1efdd69d088e652
BLAKE2b-256 fed14fb98dc1667a8a66c77218f40414e8c50f476decf6876b3f6ff32a3ca653

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