0

I have the following SSH-client configuration in my local home directory:

client$ cat ~/.ssh/config 
    Host foo.example.com
    ProxyCommand  /bin/nc 192.168.0.10 2000

This configuration forwards SSH connections to foo.example.com to foo's internal (Docker) SSH service.

It works, but it is a client-side configuration. I need the same setting at server-side. I tried

server$ cat /etc/ssh/sshd_config
...
ForceCommand /bin/nc 192.168.0.10 2000
...

but it doesn't work. Any suggestions?

2

Forwarding on ssh server-side is not possible. you can use rinetd or iptables to redirect TCP session that comes from a specific host and port.

  • It is a pity because iptables/TCP redirects are not an option in my case. Thank you for the clarification. – user2694588 Aug 9 '16 at 9:16
  • Then rinetd may be your solution. please see here: lenzg.net/rinetd/rinetd.html – 0x0C4 Aug 9 '16 at 11:23

Your Answer

By clicking "Post Your Answer", you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.