I got it to work, thanks all!<div><br></div><div>Turns out my timeout was set too low.. D&#39;oh.  </div><div><br></div><div>Greg<br><br><div class="gmail_quote">On Mon, Oct 18, 2010 at 12:34 PM, David Brain <span dir="ltr">&lt;<a href="mailto:dbrain@gmail.com">dbrain@gmail.com</a>&gt;</span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">From the docs it looks like the port should be in the constructor, e.g.<br>
<div class="im"><br>
<br>
$ssh = Net::SSH::Expect-&gt;new {<br>
       host=&gt;&#39;192.168.15.25&#39;,<br>
</div>       port=&gt;&#39;3007&#39;,<br>
<div class="im">       user=&gt;&#39;greg&#39;,<br>
       password=&gt;&#39;b00ya&#39;,<br>
       timeout=&gt;&#39;60&#39;<br>
);<br>
<br>
$ssh-&gt;login();<br>
<br>
<br>
</div>Disclaimer, I&#39;ve never used Net::SSH.<br>
<br>
David.<br>
<div><div></div><div class="h5"><br>
On Mon, Oct 18, 2010 at 12:05 PM, Greg Brown &lt;<a href="mailto:gwbrown1@gmail.com">gwbrown1@gmail.com</a>&gt; wrote:<br>
&gt; So.. I&#39;m having to now use Net::SSH::Expect rather than the regular Expect<br>
&gt; perl module (long story, blah blah).  Regardless I&#39;m having some problems<br>
&gt; passing port other than the default.  Here&#39;s how to connect using regular<br>
&gt; Net::SSH::Expect code:<br>
&gt; #!/usr/bin/perl<br>
&gt; use Net::SSH::Expect;<br>
&gt; $ssh = Net::SSH::Expect-&gt;new {<br>
&gt;        host=&gt;&#39;192.168.15.25&#39;,<br>
&gt;        user=&gt;&#39;greg&#39;,<br>
&gt;        password=&gt;&#39;b00ya&#39;,<br>
&gt;        timeout=&gt;&#39;60&#39;<br>
&gt; );<br>
&gt; $ssh-&gt;login();<br>
&gt; I&#39;ve tried connecting to a different port (3007 in this case) in a couple<br>
&gt; different ways.. one way was before the &quot;login()&quot; command using:<br>
&gt; $ssh-&gt;port(3007);<br>
&gt; $ssh-&gt;login();<br>
&gt; ## run some commands here<br>
&gt; $ssh-&gt;close();  # close the ssh session<br>
&gt; Another was to put the port number after the password above that.  Neither<br>
&gt; seem to work.  I can ssh from the command line to port 3007 of this router<br>
&gt; with no problems from the same machine where the script lives.<br>
&gt; Any thoughts?<br>
&gt; Greg<br>
&gt; Here&#39;s the Net::SSH::Expect support page..<br>
&gt; <a href="http://search.cpan.org/~bnegrao/Net-SSH-Expect-0.08/lib/Net/SSH/Expect.pm" target="_blank">http://search.cpan.org/~bnegrao/Net-SSH-Expect-0.08/lib/Net/SSH/Expect.pm</a><br>
&gt;<br>
</div></div>&gt; _______________________________________________<br>
&gt; Trilug-ontopic mailing list<br>
&gt; <a href="mailto:Trilug-ontopic@trilug.org">Trilug-ontopic@trilug.org</a><br>
&gt; <a href="http://www.trilug.org/mailman/listinfo/trilug-ontopic" target="_blank">http://www.trilug.org/mailman/listinfo/trilug-ontopic</a><br>
&gt;<br>
&gt;<br>
_______________________________________________<br>
Trilug-ontopic mailing list<br>
<a href="mailto:Trilug-ontopic@trilug.org">Trilug-ontopic@trilug.org</a><br>
<a href="http://www.trilug.org/mailman/listinfo/trilug-ontopic" target="_blank">http://www.trilug.org/mailman/listinfo/trilug-ontopic</a><br>
</blockquote></div><br></div>