I’m trying to build a very simple telnet client that allows me to run a
program on the server and collect its output.
I’ve opened the socket and am connecting.
I’m able to send and receive from the socket but its not returning what
I’m expecting. Can someone point me in the right direction where I can
find the protocol for telnet communications. I want to do the following:
logon
run two programs from the command line
collect the output
logoff
I’m trying to build a very simple telnet client that allows me to run a
program on the server and collect its output.
I’ve opened the socket and am connecting.
I’m able to send and receive from the socket but its not returning what
I’m expecting. Can someone point me in the right direction where I can
find the protocol for telnet communications. I want to do the following:
logon
run two programs from the command line
collect the output
logoff
This is just a suggestion, but I’ve avoided this completely by using
“expect” (it’s available as part of the DejaGNU package on quics).
The idea is that you write a simple script, like “send this”, and
“expect this”, including logging. I’ve used it, for example, to snarf
the active files from nntp sites…
YMMV
Cheers,
-RK
–
Robert Krten, PARSE Software Devices +1 613 599 8316.
Realtime Systems Architecture, Consulting and Training at www.parse.com
Email my initials at parse dot com.
That was one method that I’m trying, the other is as follows:
I’ve created a server application that listens for the request and sends
back the response. This is working (port 15000) and I get the proper
response. Now I’m trying to have it work like telnetd or ftpd so that
when the request comes in on the port, the server is automatically
started.
In /etc/services file I have added the entry:
my_server 15000/tcp
and in the inetd file I have the following:
my_server stream tcp nowait root /bin/my_server
When I run the client, I get a “execv: No such file or directory”
Any thoughts?
I’m trying to build a very simple telnet client that allows me to run a
program on the server and collect its output.
I’ve opened the socket and am connecting.
I’m able to send and receive from the socket but its not returning what
I’m expecting. Can someone point me in the right direction where I can
find the protocol for telnet communications. I want to do the following:
logon
run two programs from the command line collect the output
logoff
That was one method that I’m trying, the other is as follows:
I’ve created a server application that listens for the request and sends
back the response. This is working (port 15000) and I get the proper
response. Now I’m trying to have it work like telnetd or ftpd so that
when the request comes in on the port, the server is automatically
started.
In /etc/services file I have added the entry:
my_server 15000/tcp
and in the inetd file I have the following:
my_server stream tcp nowait root /bin/my_server
When I run the client, I get a “execv: No such file or directory”
Any thoughts?
is my_server application located in /bin ?
anyway it should be started smth like this:
my_server stream tcp nowait root /bin/my_server my_server [some other
arguments if required]
…just in order to make argv[0] in main() of your my_server to be equal to
“my_server”.
kind of ftpd does:
in /etc/passwd, set intial program for this userid to run a shell script
in shell script, run your two local programs putting results in file(s)
in shell script, run ftp with interactive login off (-i) from a script to
get back results
in shell script, logout
Doug Rixmann wrote:
I’m trying to build a very simple telnet client that allows me to run a
program on the server and collect its output.
I’ve opened the socket and am connecting.
I’m able to send and receive from the socket but its not returning what
I’m expecting. Can someone point me in the right direction where I can
find the protocol for telnet communications. I want to do the following:
logon
run two programs from the command line
collect the output
logoff