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

Client Callback For TCPIP-Forward (Remote Port Forwarding) Missing #183

Open
judgeman5 opened this issue Sep 15, 2023 · 2 comments
Open
Labels
enhancement New feature or request

Comments

@judgeman5
Copy link

Maybe I'm missing something, but is there a reason a callback isn't implemented on the client side when the server requests a remote port forward using the forward_tcpip function from the server handle. I know from the RFC docs that a client should always reject a forward_tcpip request, but couldn't we still provide a callback for it and make the default functionality deny/do_nothing. The forward_tcpip function on the server was implemented, so I don't see why we can't add a callback that can accept it on the client end.

Without this functionality, the server can't call reverse port forwards to the client, unless done through a custom task that the client needs to interpret, then open the listener, then call the client handle's channel_open_direct_tcpip to callback to the server once the tunnel has been established. I think adding the ability for the client to have a callback for a forward-tcpip call from the server could be usesful.

Apologies if I am misinterpreting something. Appreciate any help and feedback!

@Eugeny Eugeny added the enhancement New feature or request label Sep 15, 2023
@HealsCodes
Copy link

Correct me if I'm wrong but this would be a feature that'd never do anything unless you're also providing the server end of the code knowing about the ability of the client to accept new reverse forwards at runtime - wouldn't it?

With standard RFC conform client / server setups it's always the client knowing which ports should be forwarded from the client side to the server (local and dynamic listen [-L / -D for openssh]) or server to client (remote listen [-R for openssh]) with the server having no actual ability to signal a forward_tcpip to the client; and even if it had, having to expect that the client would simply reject it anyway because the RFC states that it should.

@judgeman5
Copy link
Author

@HealsCodes

Fair point and it makes sense why this functionality is not in there. If you read description under the issue, I lay out some reasoning and mention that RFC does mention this is not possible/should be denied. I just think it would be a nice to have and the Russh library has the ability to do custom messaging not found on other SSH libs. I tried to look for RFC SSH docs related to the OpenDirectStreamLocal (this is implemented in Russh), but couldn't find anything so just thought this would be another cool feature RFC SSH doesn't support.

I just think it's a unique feature to add and has some use cases.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

3 participants