[BusyBox] Scriptable telnet?

Csaba Henk ekho at renyi.hu
Sun Jan 11 14:02:01 UTC 2004



On Tue, 6 Jan 2004, Rob Landley wrote:

> On Tuesday 06 January 2004 05:50, Csaba Henk wrote:
> > On Mon, 5 Jan 2004, Gyepi SAM wrote:
> > > On Mon, Jan 05, 2004 at 05:34:02PM +0100, Csaba Henk wrote:
> > > > --===============2109340540=
> > > > Content-Type: TEXT/PLAIN; charset=US-ASCII
> > > >
> > > > Hi,
> > > >
> > > > I'd need a scriptable telnet client for busybox, ie. one such that you
> > > > can send commands to, eg. via a fifo, like it's done in
> > > >
> > > > http://okmij.org/ftp/piped_agents.txt
> > >
> > > You can also use nc instead.
> >
> > The situation is that I want to script a telnet session. The best beast
> > for communicating with a telnet server is a telnet client, ain't it? Using
> > nc would mean writing a telnet client in shell... that's not what I want.
>
> I don't think so.  What are you trying to do?

I want to make shfs (

http://shfs.sourceforge.net

 -- it is a shell based network filesystem) work with busybox as mounter
and/or host. Currenlty shfs may use ssh and rsh for getting a remote
shell. As busybox has client+server only for telnet, I thought the
best/funniest solution would be porting shfs to telnet. Using busybox nc +
a shell wrapper as telnet client is a possibility, of course.

> Nc is basically telnet without the terminal control features.  It doesn't do
> things like negotiate with the telnet server to propogate environment
> variables, and other such complexity.  It just connects stdin an stdout to a
> remote socket through the network.  Exactly what you want for scripting
> purposes.

If I want to connect to a telnet server, I do have to negotiate with it.
I didn't really succeed in it... I tried
"echo -en 'ls\r\0' | nc <host> <port>" and many similar commands, with
busybox and inetutils telnet servers. With bb telnetd, sometimes the
output of the command came back, sometimes didn't, it was very rhapsodic,
I don't know what it depended on. With inetutils telnetd, I had no success
at all. Any hints are welcome on how to get it working.

Csaba



More information about the busybox mailing list