I have services running (in docker containers) on a remote server for which I have ssh access.
These services are admin apis that I'd prefer not to expose to the world(I don't really fancy setting up authentication for each of those services, and having more passwords to manage, when only a few admins who already have ssh access might need to use them). Still, I'd like to be able to interact with those services from my workstation(using the tools installed on my workstation). I'd like to reuse my existing ssh authentication.
Ideally, what I'd want is to create a secure tunnel connection to the remote server once, and use it to access those apis which are only listening to requests coming from the local network(i.e. as if from
localhost), so that only those able to ssh to the server can access those apis.
I don't think it's possible to proxy traffic "through" the remote loopback interface, but is there a way to have those services only listen to connections proxied through the server, without needing to have configuration specific to each service(like a firewall rule for each port)?
I've been playing around and trying to understand different methods of ssh tunneling, e.g.
ssh -D ...,
ssh -L ...,
ssh -R ..., ... but they don't allow me to access services listening to the remote "localhost", so I'd have to have firewall rules anyway.