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

client$ cat ~/.ssh/config 
    Host foo.example.com
    ProxyCommand  /bin/nc 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 2000

but it doesn't work. Any suggestions?


1 Answer 1


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. Aug 9, 2016 at 9:16
  • Then rinetd may be your solution. please see here: lenzg.net/rinetd/rinetd.html
    – 0x0C4
    Aug 9, 2016 at 11:23

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .