OESF Portables Forum
General Forums => General Discussion => Topic started 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
-
Is telnetd running? Can you manually telnet to the Zaurus?
Felipe
-
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
-
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
-
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.