0

I have an entry in my .ssh/config file that looks like:

Host ip-172-16-*

ProxyCommand ssh jeff@jumpdev.example.org nc %h %p
User ubuntu
IdentityFile ~/.ssh/id_rsa_aws
StrictHostKeyChecking no
ForwardAgent yes

As most know this will allow me to run: ssh ip-172-16-2-108.ec2.internal and I drop onto the private server, as the default user for Ubuntu EC2 instances - ubuntu. I'm looking to take some specific actions on create.

Ultimately what i am looking for is the same functionality with either scala-ssh, jassh or directly from jsch

I'm not asking for anyone to suggest a library, just how/if this functionality is supported. With jassh, i've attempted with the Proxy options with no luck.

Ultimately i could shell out directly to ssh, but even with ammonite, it won't load the config if using %('ssh, Symbol("ip-172-16-2-108.ec2.internal"). I thought that would use the base ssh, which would load the config and match, like bare ssh. I could also set up my config not to use nc

This does sound like i'm asking for a library, so if it gets closed, so be it, but i've tried 4 directly and none, seem to completely support .ssh/config

TIA, Jeff

ekydfejj
  • 339
  • 2
  • 14
  • 1
    So if you're not asking to suggest the library, what exactly is your question? – lexicore Mar 26 '18 at 21:16
  • If one of these libraries can accommodate `.ssh/config` options, specifically `ProxyCommand`, i've just found out that `jsch` does not parse that option. Even though it does support an openSSHOption parser, Which rules out likely all of them :( . Mainly been banging my head against the wall...so i come here :) – ekydfejj Mar 26 '18 at 21:38
  • 1
    this [library](https://github.com/cronn-de/ssh-proxy) looks appealing, am going to try it out. – ekydfejj Mar 26 '18 at 22:07

1 Answers1

0

I know there are other answers, but I found that by switching from ProxyCommand to ProxyJump in my .ssh/config allowed ammonite to work perfectly. Also since all I need is a solution to this problem and am already using ammonite, it is a good match.

If others have other experiences, I think this is a good question to leave open, as we're talking about specific libraries which are all built off Jcsh.

FWIW, my .ssh/config now looks like:

Host ip-172-16-*
  ProxyJump jeff@jumpdev.example.org
  User ubuntu
  IdentityFile ~/.ssh/id_rsa_aws
  StrictHostKeyChecking no
  ForwardAgent yes

Hope this helps someone.

ekydfejj
  • 339
  • 2
  • 14