Question

I'm looking for a methodology to SSH over SSH (as in the title).

So, I know I can do :

ssh -t user1@proxyServer ssh user2@farAwayServer

Or I can use the ProxyCommand with nc, but I don't want to use one connection to the proxyServer by connection to every farAwayServer. And I know I can use ControlMaster, but I'm not really happy with this solution too.

I rather prefer something like :

ssh -t -Dlocalhost:2222 user1@proxyServer
ssh (something to use the localhost:2222) user2@farAwayServer

Is this solution exist and if Yes how ?

Thanks for your help

Was it helpful?

Solution

ProxyChains or tsocks would allow you to redirect ssh network connections through the SOCKS proxy.

Another option is to use socat (that understands SOCKS4/5) combined with the ProxyCommand.

OTHER TIPS

Probably I havn't understood exactly what you are saying. Do you want to connect to a SSH host while connected to an other ssh host right?

Then why should you do it by typing the two commands in line when you can access the first host and then access the second. Do you really need a third hand software for doing it? Isn't it better to connect each time with one single connection?

Shell connection are already much difficult to handle for a service provider I don't see any reason to make it more difficult unless you what to do something weird and in that case, on probably there is lots of software you can use to connect to various host at the same time with an encripted connection. But stay tuned about the logs and the traces an open shell could live into every system you pass through.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top