A small ruby script to automate sshing into an elasticbeanstalk instance or an ec2 instance.
- Run
bundle install
- Follow these instructions to setup your aws config file https://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html
- Add this to your
.ssh/config
file:
Host eb-*
ProxyCommand bash -c "nc $(/path/to/eb-ssh.rb %h) %p"
User ec2-user
IdentityFile ~/.ssh/aws_key.pem
Host i-*
ProxyCommand bash -c "nc $(/path/to/i-ssh.rb %h) %p"
User ec2-user
IdentityFile ~/.ssh/aws_key.pem
- Optionally you may want to change the
#!
line ineb-ssh.rb
andi-ssh.rb
to a specific ruby if you have many, but should be fine as the default for most users. - You're now ready to
ssh eb-name-of-beanstalk
orssh instance-id
!