I can listen to a terminal on the server using
netcat. So to see typing on the serial port of the remote machine I can use
where 8701 is the outgoing port I use on the serial to ethernet converter.
I can direct listened output into a file
I can send data back to the terminal using the designated import port 8702
Code:
echo "Some stuff"|nc 192.168.0.64 8702
where 192.168.0.64 is the IP of the ethernet converter
What I would like to do is
Code:
nc -l 8701 | bash | nc 192.168.0.64 8702
The idea being that listened data goes to a shell and the output from the shell is sent back to the terminal. The problem seems to be the bash or sh invocation not responding or sending back to the terminal through netcat.
I could write a Python program (because Python is the easiest) that listens on a port executes the OS command collects the output and sends back to the IP device but that is a a bit of effort and may not work anyway. Probably should be written in C or I could get the code for agetty and modify that which is a lot of work too.
Any suggestions?