UNIX Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsOperating SystemsUNIX Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Dell PowerEdge Servers
  #1  
Old August 21st, 2004, 09:11 PM
mryge mryge is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2004
Posts: 1 mryge User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
Expect and SSH in Cygwin

Hi,

I am trying to connect to a remote Windows Server 2003 machine via SSH from my local machine.

The remote machine runs an OpenSSH server. I tried to connect with an OpenSSH client in Cygwin. From the (Cygwin) bash, I typed:
$ ssh remote_machine -l Administrator

Then, the bash would output:
"Administrator@remote_machine's password: "

This complete procedure worked fine. However, when I ran my Expect script, issh.tcl, to do the same thing, I got frustating *unexpected* behaviors.

--- Expect script (start) ---
#!/bin/sh
# \
exec tclsh "$0" ${1+"$@"}
package require Expect

spawn ssh remote_machine -l Administrator
expect "password: "
send "my_password\r"
expect "Administrator>"
--- Expect script (end) ---

When I ran the script with -d option:
--- start ---
expect version 5.26
argv[0] = expect argv[1] = -d argv[2] = issh.tcl
set argc 0
set argv0 "issh.tcl"
set argv ""
executing commands from command file issh.tcl
spawn ssh remote_machine -l Administrator
parent: waiting for sync byte
parent: telling child to go ahead
parent: now unsynchronized from child
spawn: returns {3420}

expect: does "" (spawn_id 4) match glob pattern "password: "? no
Administrator@remote_machine's password:
--- end ---

The strange thing is on the line: expect: does "" (spawn_id 4) match glob pattern "password: "? no.

Why did I get ""? What character is that? If I connected directly (without using Expect), I never received the "".

Any help is greatly appreciated.


Memomana

Reply With Quote
Reply

Viewing: Dev Shed ForumsOperating SystemsUNIX Help > Expect and SSH in Cygwin


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

 Free IT White Papers!
 
Accelerating Trading Partner Performance
One in five. That's how many partner transactions have at least one error. That is an amazing statistic, particularly given the extraordinary leaps in innovation across the global supply chain during the past two decades. Download this white paper to learn more.

 
Competing on Analytics
This Tech Analysis is designed to help identify characteristics shared by analytics competitors, and includes information about 32 organizations that have made a commitment to quantitative, fact-based analysis.

 
Cost Effective Scaling with Virtualization and Coyote Point Systems
An overview of the industry trend toward virtualization, how server consolidation has increased the importance of application uptime and the steps being taken to integrate load balancing technology with virtualized servers.

 
Five Checkpoints to Implementing IP Telephony
Implementation planning for IP PBX software and IP telephony has become vital as businesses replace discontinued legacy PBX phone systems. This informative whitepaper outlines five "checkpoints" for any implementation plan that will help make IP communications a successful proposition.

 
Hosted Email Security: Staying Ahead of New Threats
In the last two years, email has become a fierce battleground between the nefarious forces of spam and malware, and the heroes of messaging protection. The spam volumes increased alarmingly every month, bringing clever new forms of phishing and virus propagation attacks.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway