[Trilug-ontopic] anyone using Net::SSH::Expect?
Greg Brown
gwbrown1 at gmail.com
Mon Oct 18 13:08:58 EDT 2010
I got it to work, thanks all!
Turns out my timeout was set too low.. D'oh.
Greg
On Mon, Oct 18, 2010 at 12:34 PM, David Brain <dbrain at gmail.com> wrote:
> From the docs it looks like the port should be in the constructor, e.g.
>
>
> $ssh = Net::SSH::Expect->new {
> host=>'192.168.15.25',
> port=>'3007',
> user=>'greg',
> password=>'b00ya',
> timeout=>'60'
> );
>
> $ssh->login();
>
>
> Disclaimer, I've never used Net::SSH.
>
> David.
>
> On Mon, Oct 18, 2010 at 12:05 PM, Greg Brown <gwbrown1 at gmail.com> wrote:
> > So.. I'm having to now use Net::SSH::Expect rather than the regular
> Expect
> > perl module (long story, blah blah). Regardless I'm having some problems
> > passing port other than the default. Here's how to connect using regular
> > Net::SSH::Expect code:
> > #!/usr/bin/perl
> > use Net::SSH::Expect;
> > $ssh = Net::SSH::Expect->new {
> > host=>'192.168.15.25',
> > user=>'greg',
> > password=>'b00ya',
> > timeout=>'60'
> > );
> > $ssh->login();
> > I've tried connecting to a different port (3007 in this case) in a couple
> > different ways.. one way was before the "login()" command using:
> > $ssh->port(3007);
> > $ssh->login();
> > ## run some commands here
> > $ssh->close(); # close the ssh session
> > 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.
> > Any thoughts?
> > Greg
> > Here's the Net::SSH::Expect support page..
> >
> http://search.cpan.org/~bnegrao/Net-SSH-Expect-0.08/lib/Net/SSH/Expect.pm
> >
> > _______________________________________________
> > Trilug-ontopic mailing list
> > Trilug-ontopic at trilug.org
> > http://www.trilug.org/mailman/listinfo/trilug-ontopic
> >
> >
> _______________________________________________
> Trilug-ontopic mailing list
> Trilug-ontopic at trilug.org
> http://www.trilug.org/mailman/listinfo/trilug-ontopic
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.trilug.org/pipermail/trilug-ontopic/attachments/20101018/39ea583f/attachment.htm>
More information about the Trilug-ontopic
mailing list