AWSSH Config
Perhaps you've encountered this because you're sick of checking the AWS console to find the public DNS of the particular machine you're working with. Perhaps it's because you work with dozens or hundreds of machines on AWS and simply can't keep track of them. Or perhaps it's out of shame from remembering the actual AWS-provided name for your instances.
It's the future, and we can use ssh config. So, where's my flying car?
Installation
You'll need python's setuptools:
# On Linux:
sudo apt-get install python-setuptools
# Or, alternatively
sudo yum install python-setuptools
# On Mac
sudo port install py-setuptools
With that installed, you're ready to rock-and-or-roll!
sudo python ./setup.py install
Configuration
This package uses boto, which checks for a configuration file ~/.boto
. You can
add your access ID and secret key to that file such:
[Credentials]
aws_access_key_id = <your id here>
aws_secret_access_key = <you get the picture>
If a remote instance uses keypair production
, then this package assumes that your
keyfile resides locally at ~/.ssh/production
.
Running
# Easy-peasy
awssh-config
What it is and does
A quick way to get a list of all your instances by name, and automatically set up
your ~/.ssh/config
to enable you to log into your EC2 instances by name. A few
things to keep in mind:
- It will not clobber information in existing ssh config
- Be that as it may, it does not preserve order
- It does preserves comments
- Saves a backup copy at
~/.ssh/config.bak
- Assumes key name
production
lives at~/.ssh/production
- It is interruptable without corrupting
~/.ssh/config
Roadmap
- Support for multiple AWS accounts
- Read an optional 'User' tag to designate the username for each machine