mholt/caddy-l4

feature request: reverse proxy ssh via username

Opened this issue · 3 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,

git@example.com   -> caddy-l4 -> git@git.internal
host1@example.com -> caddy-l4 -> user@host1.internal

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 !

mholt commented

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!

tg123 commented

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.

mholt commented

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