Author Topic: telnet  (Read 2015 times)

bugouzhi

  • Guest
telnet
« 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

jfv

  • Sr. Member
  • ****
  • Posts: 437
    • View Profile
telnet
« Reply #1 on: November 12, 2004, 02:26:51 pm »
Is telnetd running? Can you manually telnet to the Zaurus?
Felipe
SL 5000 D  and C860 Sharp ROM
Too many accessories...

bugouzhi

  • Guest
telnet
« Reply #2 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

Stubear

  • Hero Member
  • *****
  • Posts: 1164
    • View Profile
    • http://
telnet
« Reply #3 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
SL-C1000, Hand converted to English with Japanese Input
Running X apps via X/Qt
iRiver USB host cable; Diatec P-Cord usb power cable (extendable); Acro's Reel Cable USB (A to A, B, Mini-B,  & Mini-B 8pin); GreenHouse 1Gb PicoDrive+; 2x256Mb Hagiwara SD cards; 128Mb Transcend CF card; 512Mb PQI CF card; AmbiCom WL1100C-CF 11B WLAN card

ScottYelich

  • Hero Member
  • *****
  • Posts: 992
    • View Profile
    • http://www.zaurususergroup.com/modules.php?opmodload&namephpWiki&filei
telnet
« Reply #4 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

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.
« Last Edit: November 15, 2004, 09:05:49 am by ScottYelich »