openssh icon indicating copy to clipboard operation
openssh copied to clipboard

Passthrough OpenSSH client?

Open shymega opened this issue 1 year ago • 4 comments

Hi,

I found this crate when writing a Rust wrapper around ssh. It looks like what I need, but I'd like to be able to 'pass through' the SSH client-specific arguments to this crate.

Is that possible?

Thanks.

shymega avatar Aug 25 '24 08:08 shymega

SessionBuilder contains many options supported, depending on the use case they might be enough.

I don't think it's a good idea to pass unsanitized args directly to ssh, but if there's a use case, I'd accept a PR to add a new method to it.

NobodyXu avatar Aug 25 '24 08:08 NobodyXu

@NobodyXu I just came across this crate and I was wondering if @shymega's request was about adding dynamic the application-level port forwarding (SOCKS5) option -D to the session.

Perhaps there is already a way to do this with the crate and I haven't seen it, but if not, would this be an acceptable use case?

miguelgila avatar Oct 27 '24 17:10 miguelgila

I didn't say anything about SOCKS5. I just wanted to be able to pass through args to the SSH call.

shymega avatar Oct 27 '24 17:10 shymega

Perhaps there is already a way to do this with the crate and I haven't seen it, but if not, would this be an acceptable use case?

@miguelgila Yes I will accept a PR for that.

it's already supported by the openssh-mix-client and -D via ssh cli, so it'd be relatively simple:

https://docs.rs/openssh-mux-client/latest/openssh_mux_client/struct.Connection.html#method.request_dynamic_forward

NobodyXu avatar Oct 29 '24 07:10 NobodyXu