Problem with a Script

Warren Young warren@etr-usa.com
Thu Nov 8 21:36:00 GMT 2007


Tughan Hafizoglu wrote:
> $ ( echo "root" ;
> 
>       sleep 1;
> 
>      echo "password";
> 
>       sleep 1;
> 
>      echo "df";
> 
>        sleep 1 ) | telnet 192.168.0.X

Why not use ssh instead?  Use keys instead of passwords and you get 
automatic logins easily.  You can even pass the command to execute on 
the remote server after login if you want.

> When I try running this on Cygwin shell which runs on the windows 2003
> box, it opens the Microsoft Telnet Client 

Maybe if you install the inetutils package this will be fixed, because 
then you'll be using Cygwin's telnet.  But again, I think it's better to 
avoid this automatic login hack to begin with.



More information about the Cygwin-apps mailing list