caddy-l4 icon indicating copy to clipboard operation
caddy-l4 copied to clipboard

feature request: reverse proxy ssh via username

Open rmmanseau opened this issue 3 years ago • 5 comments

It would be cool if the ssh matcher allowed matching against a user, and if the handler allowed you to pass the request on to a different user. ie,

[email protected]   -> caddy-l4 -> [email protected]
[email protected] -> caddy-l4 -> [email protected]

basically exactly what tg123/sshpiper does. i think itd be cool if caddy-l4 could support reverse proxying ssh in this manner by default.

apologies in advance if this doesnt seem feasible or its outside of the scope of this plugin !

rmmanseau avatar Jul 13 '22 04:07 rmmanseau

Ah yeah, that'd be cool. I'd never heard of sshpiper; thanks for the link. I wonder if it can be used as a library.

I don't think I have much bandwidth in the near future to implement this, but I could prioritize it if a business wants to sponsor its development, or I'd welcome pull requests and could review those no problem!

mholt avatar Jul 13 '22 05:07 mholt

you can either use sshpiper as a lib or drop a plugin along with sshpiperd

https://github.com/tg123/sshpiper/blob/master/CONTRIBUTING.md#understanding-how-sshpiper-works

sshpiper seasoned cryto ssh lib The crypto folder contains the source code of the sshpiper seasoned cryto ssh lib. It based on crypto/ssh and with a drop-in sshpiper.go to expose all low level sshpiper required APIs.

tg123 avatar Jul 13 '22 16:07 tg123

Very nice! Thanks for the tip @tg123. That's very helpful.

mholt avatar Jul 13 '22 16:07 mholt