August 30, 2011

simple telnet server by using socat

On server side:

./socat exec:'bash -li',pty,stderr,setsid  tcp-listen:8999,reuseaddr

On client side:

./socat tcp-connect:127.0.0.1:8999 file:`tty`,raw,echo=0

2 comments:

  1. how to do it with other serial device ports please, like /dev/ttyS0
    This is not working
    ./socat exec:'bash -li',/dev/ttyS0,stderr,setsid tcp-listen:8999,reuseaddr

    ReplyDelete
  2. Perfect, just what I was looking for. Thanks.

    Aaron Moate
    CHTC Infrastructure Team

    ReplyDelete