I got it to work, thanks all!<div><br></div><div>Turns out my timeout was set too low.. D'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"><<a href="mailto:dbrain@gmail.com">dbrain@gmail.com</a>></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->new {<br>
host=>'192.168.15.25',<br>
</div> port=>'3007',<br>
<div class="im"> user=>'greg',<br>
password=>'b00ya',<br>
timeout=>'60'<br>
);<br>
<br>
$ssh->login();<br>
<br>
<br>
</div>Disclaimer, I'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 <<a href="mailto:gwbrown1@gmail.com">gwbrown1@gmail.com</a>> wrote:<br>
> So.. I'm having to now use Net::SSH::Expect rather than the regular Expect<br>
> perl module (long story, blah blah). Regardless I'm having some problems<br>
> passing port other than the default. Here's how to connect using regular<br>
> Net::SSH::Expect code:<br>
> #!/usr/bin/perl<br>
> use Net::SSH::Expect;<br>
> $ssh = Net::SSH::Expect->new {<br>
> host=>'192.168.15.25',<br>
> user=>'greg',<br>
> password=>'b00ya',<br>
> timeout=>'60'<br>
> );<br>
> $ssh->login();<br>
> I've tried connecting to a different port (3007 in this case) in a couple<br>
> different ways.. one way was before the "login()" command using:<br>
> $ssh->port(3007);<br>
> $ssh->login();<br>
> ## run some commands here<br>
> $ssh->close(); # close the ssh session<br>
> Another was to put the port number after the password above that. Neither<br>
> seem to work. I can ssh from the command line to port 3007 of this router<br>
> with no problems from the same machine where the script lives.<br>
> Any thoughts?<br>
> Greg<br>
> Here's the Net::SSH::Expect support page..<br>
> <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>
><br>
</div></div>> _______________________________________________<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>
><br>
><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>