hymkor/expect

Telnet login

tangingw opened this issue · 5 comments

When I use the expect for telnet login, it shows this at login

username: t?ngi?gw (the ? appaears to be random
password:

%Authentication failed.

My spawn part is this:

ipAddress = arg[1]

if spawn([[c:\Users\tangingw\Desktop\plink.exe ]], "-telnet", ipAddress) then

Is the server that you login , Windows Server ?
And do you succeed to telnet only by plink.exe without expect.exe ?

Actually it is a Cisco device. I can login to the device by just using plink.exe --telnet

I tested plink.exe and expect.exe.
plink.exe is too slow to recieve all keyboard event.
expect.exe must send keyboard events more slowly.
I would try.

Please download the latest version: https://github.com/zetamatta/expect/releases/tag/20180808

And, replace send("...") to send("...",500) for example.
500 means send() command wait 0.5 second per 1-character.
If too slow, decrease the number. If it fails, increase.

Ok. I tested your modification, with plink.exe. With a delay of 1 ms, it works like charm, but it starts to prompt the error that I showed you on the previous thread if I limit the delay to 0.5 ms.