Originally Posted by
lollobrigido
Excuse me but I'm very newbie in linux programming... infact I don't understand how both programs proposed (by cornedbee e brewbook) can "redirect" the data extracted from the tcp packet to tty...
Both netcat and tcpserver listen on a socket. When a client connects, all data send by the client is directed to a file or device. Similarly, any data read from the device is sent back to the client. Sounds like basically what you need.
Netcat simply redirects the input to standard output. So to connect the socket to the device, you simply redirect netcat into the device:
Code:
nc -l 9919 > /dev/tty
In practice you would need to place the tty into the proper mode. You might do this with a smaller wrapper program, say, "initty":
Code:
nc -l 9919 | initty /dev/tty
Or something like it.
Netcat only supports one-way communication as far as I know. tcpserver may be more full-featured, but I have not used it.