Skip to content

Update hosts file based on ec2 instance metadata

Notifications You must be signed in to change notification settings

atongen/ec2_hosts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ec2_hosts

Update your hosts file based on ec2 compute instances.

This is handy when used in conjunction with something like sshuttle, allowing you to have a "poor man's vpn".

Installation

$ gem install ec2_hosts

Requirements

Usage

Example

Update your hosts file using ec2_hosts:

$ sudo ec2_hosts -p my-cool-project --public bastion

Start sshuttle session:

$ sshuttle --remote=bastion01 --daemon --pidfile=/tmp/sshuttle.pid 192.168.1.0/24

Now your hosts file will contain entries for all compute instances in the project, and you can ssh directly to them from your local machine.

Hosts matching the pattern passed in with the --public flag will have their public IP address added to your host file instead of the their private internal IP address.

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/atongen/ec2_hosts.

About

Update hosts file based on ec2 instance metadata

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages