cloudposse / bastion

🔒Secure Bastion implemented as Docker Container running Alpine Linux with Google Authenticator & DUO MFA support
https://cloudposse.com/accelerate
Apache License 2.0
643 stars 112 forks source link

ssh config help #25

Closed dmcd closed 6 years ago

dmcd commented 6 years ago

Is it possible to use this bastion as a forwarding agent when supplying a private key to the destination host? I can't seem to get the following to work?

Host bastion
  HostName <bastion-ip>
  Port 1234
  ForwardAgent   yes

Host 10.0.1.23
  IdentityFile ~/.ssh/key.pem
  ProxyCommand ssh dmcd@bastion -W %h:%p
dmcd commented 6 years ago

I remembered that I need to ssh in one single command to use ForwardAgent correctly: i.e.

Host bastion
  HostName <bastion-ip>
  Port 1234
  User dmcd
  ForwardAgent   yes
  StrictHostKeyChecking no

and then: ssh -t bastion ssh ec2-user@x.x.x.x