So.. I&#39;m having to now use Net::SSH::Expect rather than the regular Expect perl module (long story, blah blah).  Regardless I&#39;m having some problems passing port other than the default.  Here&#39;s how to connect using regular Net::SSH::Expect code:<div>
<br></div><div>#!/usr/bin/perl</div><div><br></div><div>use Net::SSH::Expect;</div><div><br></div><div>$ssh = Net::SSH::Expect-&gt;new {</div><div>       host=&gt;&#39;192.168.15.25&#39;,</div><div>       user=&gt;&#39;greg&#39;,</div>
<div>       password=&gt;&#39;b00ya&#39;,</div><div>       timeout=&gt;&#39;60&#39;</div><div>);</div><div><br></div><div>$ssh-&gt;login();</div><div><br></div><div>I&#39;ve tried connecting to a different port (3007 in this case) in a couple different ways.. one way was before the &quot;login()&quot; command using:</div>
<div><br></div><div>$ssh-&gt;port(3007);</div><div>$ssh-&gt;login();</div><div><br></div><div>## run some commands here</div><div><br></div><div>$ssh-&gt;close();  # close the ssh session</div><div><br></div><div>Another was to put the port number after the password above that.  Neither seem to work.  I can ssh from the command line to port 3007 of this router with no problems from the same machine where the script lives.</div>
<div><br></div><div>Any thoughts?</div><div><br></div><div>Greg</div><div><br></div><div>Here&#39;s the Net::SSH::Expect support page..</div><div><br></div><div><a href="http://search.cpan.org/~bnegrao/Net-SSH-Expect-0.08/lib/Net/SSH/Expect.pm">http://search.cpan.org/~bnegrao/Net-SSH-Expect-0.08/lib/Net/SSH/Expect.pm</a></div>
<div><br></div>