I want to have a server to transparently forward an incoming ssh connection from a client to a docker container. This should include scp, git transport and so forth. This must work with keys, passwords are deactivated. The user should not see the server. Update: Yes, this really means that the user shall be unaware that there is a server. The configuration must take place entirely on the server!
client -----> server -----> container (actual connection)
client -------------------> container (what the user should see)
So, what is given is this:
user@client$ ssh user@server
user@server$ ssh -p 42 user@localhost
user@container$
But what I want is this:
user@client$ ssh user@server
user@container$
I tried using the command="ssh -p 42 user@localhost"
syntax in the authorized_keys
files, which kinda works, only that in the second ssh connection the user has to enter their password as the authentication is not passed (the server
doesn't has the private key of user
).
Further this approach doesn't work with scp
even if one enters a password.
I also heard about the tunnel=
command, but I don't know how to set that up (and the manpage is less than helpful).
I am using OpenSSH 7.5p1 on Arch.