Search code examples
sshportforwardingopenssh

Use ssh over port forwarded connection


My organisation makes us connect to our AWS environments using a "bastion" host so my openssl .ssh config file looks a bit like this:

Host bastion.*.c1.some.com
User bastionuser
ProxyCommand none
StrictHostKeyChecking no
ForwardAgent yes

Host *.c1.some.com 12.345.* 456.12.1.*
User awsuser
StrictHostKeyChecking no
ForwardAgent yes
ProxyCommand ~/.ssh/proxy_command.sh %h %p 

I want to use an ssh client built into the CLion IDE to connect to my AWS environment but it does not support this kind of configuration.

Can I setup a port forward using openssl and then establish an ssh connection over that tunnel from within CLion?


Solution

  • I was able to setup a port forward using PuTTY and afterwards I was able to establish a second ssh connection over the port forward using Intellij. For some reason I couldn't establish the second ssh connection over the OpenSSH port forward, perhaps because the Git Bash environment is sandboxed or something?

    Presumably this will also work with any other SSH client that doesn't support tunneling out of the box.