I was tired to search the IP for an autoscaling or ELB instance in the EC2 instances table, copy and then SSH to it so I wrote a small script to help me with this. The goal was to provide just the instance ID (and if required also username and port) to ssh into the instance.
- Python 2 (Tested 2.7)
- boto
luzifer@knut-workstation01 ~> issh -u ubuntu i-7f98d53c
Welcome to Ubuntu 14.04.1 LTS (GNU/Linux 3.13.0-35-generic x86_64)
[...]
ubuntu@ip-10-5-40-97:~$ logout
Connection to 10.5.40.97 closed.
luzifer@knut-workstation01 ~>
luzifer@knut-workstation01 ~> issh -h
usage: issh [-h] [-p port] [-u user] instance_id
Searches instance IP and connects via SSH
positional arguments:
instance_id ID of the instance in format "i-XXXXX"
optional arguments:
-h, --help show this help message and exit
-p port Port to connect to (default 22)
-u user User to use for connection (default current username)
luzifer@knut-workstation01 ~>