ec2-ssh

SSH into EC2 instances via tag name


Keywords
amazon
License
MIT
Install
pip install ec2-ssh==1.2

Documentation

ec2-ssh

https://travis-ci.org/YPlan/ec2-ssh.svg?branch=master

A pair of command line utilities for finding and SSH-ing into your Amazon EC2 instances by tag (such as 'Name').

Forked from Instagram original code by YPlan.

Installation

From pip:

pip install ec2-ssh

Usage

# ec2-ssh

% ec2-ssh nginx2
# equivalent to
# ssh ubuntu@ec2-123-45-67-89.compute-1.amazonaws.com

% ec2-ssh root@appserver
% ec2-ssh deploy@nginx2 sudo restart nginx

# Specifying the user with an environment variable
% EC2_SSH_USER=deploy ec2-ssh nginx2

# ec2-host

# w/o arg: prints all active instances
% ec2-host
ec2-123-45-67-89.compute-1.amazonaws.com
ec2-132-45-67-89.compute-1.amazonaws.com
ec2-231-45-67-89.compute-1.amazonaws.com

# w/ arg
% ec2-host backend
ec2-132-45-67-89.compute-1.amazonaws.com
ec2-132-45-67-90.compute-1.amazonaws.com

# w/ tag arg too
% ec2-host -t environment production
ec2-132-45-67-90.compute-1.amazonaws.com
ec2-111-45-67-90.compute-1.amazonaws.com