Skip to content

Instantly share code, notes, and snippets.

@louiszuckerman
Last active August 29, 2015 14:26
Show Gist options
  • Save louiszuckerman/48f06e53f991e672d50e to your computer and use it in GitHub Desktop.
Save louiszuckerman/48f06e53f991e672d50e to your computer and use it in GitHub Desktop.
SSH to EC2 host by Instance ID
#!/bin/bash
# Usage: essh { instance id } [ subcommand ]
ssh -X $(aws ec2 describe-instances --instance-ids $1 --query "Reservations[0].Instances[0].PublicIpAddress" --output text) $2
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment