I'm trying to ssh on to an ec2 instance via an internal server that actually has the key that can access the machine.
The target machine, does not have a fixed ip, ie, it is a beanstalk machine, so I have a script that returns the ips for my required environment.
I have the following so far, but I can't seem to get it to work:
# The gateway machine. I can ssh this directly from my machine. Host production HostName <ip> User <user> # The ip returned by the instancefinder can only be ssh'ed to via the gateway server ie, "production" Host production-eb:* User ec2-user ProxyCommand ssh production nc -q 10 -w 10 $(~/bin/instancefinder %h | tail -n1) %p
If I provide the
IdentityFile for the
production-eb:* config, it looks for it on my own machine. How do I get it to use this key on the gateway machine?
If this is not the way to get this to work, what do I do instead?