Reputation: 51
I try to use telnet in a script (to be use in python program). I want to do the connection, send a command, and exit the connection in juste one line. The command i want to send is to start a program on a remote machine but I d'ont want to wait the end of this program to exit the telnet connection.
I try to do : "echo myCommand | netcat 192.168.1.50 23" but it waits the end of the program.
thanks for your help
Upvotes: 2
Views: 4576
Reputation: 3141
Use bash builtin tcp socket feature:
echo yourCommand >/dev/tcp/192.168.1.50/23
Upvotes: 6