Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow to define SSH connection options #1301

Closed
yajo opened this issue Aug 20, 2018 · 3 comments
Closed

Allow to define SSH connection options #1301

yajo opened this issue Aug 20, 2018 · 3 comments

Comments

@yajo
Copy link

yajo commented Aug 20, 2018

Description

The new ssh connection introduced in #1014 does not allow to define many SSH options that are sometimes needed.

It indeed supports ~/.ssh/config, but what about portability?

Possible solutions that come to my mind:

  • Allow to specify the SSH command itself, with all but the host, user and port.
  • Allow to specify a custom config file (e.g. ssh -F /tmp/other_config) that can be filled by a script previously.
  • Allow to specify SSH options (e.g. docker -H ssh://example.com -o ForwardAgent=yes -o 'ProxyCommand=/usr/bin/nc -X connect -x 192.0.2.0:8080 %h %p ' container ls)

Current workaround would be for a script to override current $PATH and prepend a different ssh binary that proxies to the original one. But that's hacky!

@sgreben
Copy link

sgreben commented Feb 27, 2019

Also need this. For now, I'm using with-ssh-docker-socket (disclaimer: i built that). It lets you specify the SSH command using go-templates, e.g.:

$ with-ssh-docker-socket \
    -ssh-app='ssh -nNT -L "{{.LocalPort}}:{{.RemoteSocketAddr}}" "{{.RemoteHost}}"' \
    -a user@remote-host \
    docker ps # (or any other command, e.g. docker-compose)

Also there's an -ssh-app-extra-args flag that maps to the .ExtraArgs template variable, which is used in the preset templates (-ssh-app-openssh, -ssh-app-putty).

I would prefer to use docker's built-in SSH support, but having to re-write ~/.ssh/config is a deal-breaker for me, hence the wrapper approach until this lands.

@SomniVertix
Copy link

Just adding another use case here.

I've been looking at trying to split up my terraform modules into two main parts: instance and container. This allows me to separate concerns and only update/rebuild my container when absolutely need-be.
Anyways, this feature (mainly passing a file for ssh keys and furthermore, allowing connection through a Bastion box) would allow me to SSH into the boxes that I'm building with terraform.

Just a small additional use case :)

@bsousaa
Copy link
Contributor

bsousaa commented Jan 31, 2023

We have no plans at the moment to extend the scope of this feature. So, I'm closing this issue for now but we can possibly reconsider in the future.

@bsousaa bsousaa closed this as not planned Won't fix, can't repro, duplicate, stale Jan 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants