OESF Portables Forum

General Forums => General Discussion => Topic started by: bugouzhi on November 12, 2004, 01:39:18 pm

Title: telnet
Post by: bugouzhi on November 12, 2004, 01:39:18 pm
Hi all:
I am trying to do a automated telneting to some localhost on the zaurus, does anyone have any idea how to do this?
I've tried the following simple script that seems to works on other linux:
in a script telnet.sh:
sleep 1
echo <username>
sleep 1
echo <password>
sleep 1
echo <command>

then on the terminal:
./telnet.sh | telnet localhost <port>

but zaurus just seems to do anything after i execute the above command,
no return at all.  Does anyone have any ideas, or any other way to do this.

Thanks a lot.


Jian W
Title: telnet
Post by: jfv on November 12, 2004, 02:26:51 pm
Is telnetd running? Can you manually telnet to the Zaurus?
Felipe
Title: telnet
Post by: bugouzhi on November 14, 2004, 05:41:54 pm
yes the telnet server is running all right,
i can manually telnet to the localhost with no trouble.
It seems telnet is closing stdin and not accepting anything
that is sent through the pipe..
Anyone has any ideas??


Thanks

Jian
Title: telnet
Post by: Stubear on November 14, 2004, 07:46:24 pm
I don't think you can do this with telnet.

Try openshh with key files for auto login (more secure than telnet and offers more bells and whistles too). I have ssh set up on my pc and the Z and with ssh-agent I only have enter the password when I first login to my desktop after that I can ssh to the Z without entering anything - great for automated rsync backups

Stu
Title: telnet
Post by: ScottYelich on November 15, 2004, 09:02:45 am
let me see...

ok, I *fear* sharing this code:

http://www.spy.org/tmp/shell-expect-scott-example (http://www.spy.org/tmp/shell-expect-scott-example)

YOU HAVE BEEN WARNED

Scott
ps: the script has some potential for errors "$IN" should be protected like "x$IN" etc.
pps: yes, ssh *is* the way to do this.