No subject


Fri Oct 8 12:38:13 EDT 2010


$ssh =3D Net::SSH::Expect->new {
       host=3D>'192.168.15.25',
       port=3D>'3007',
       user=3D>'greg',
       password=3D>'b00ya',
       timeout=3D>'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 Expec=
t
> perl module (long story, blah blah). =A0Regardless I'm having some proble=
ms
> passing port other than the default. =A0Here's how to connect using regul=
ar
> Net::SSH::Expect code:
> #!/usr/bin/perl
> use Net::SSH::Expect;
> $ssh =3D Net::SSH::Expect->new {
> =A0=A0 =A0 =A0 host=3D>'192.168.15.25',
> =A0=A0 =A0 =A0 user=3D>'greg',
> =A0=A0 =A0 =A0 password=3D>'b00ya',
> =A0=A0 =A0 =A0 timeout=3D>'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(); =A0# close the ssh session
> Another was to put the port number after the password above that. =A0Neit=
her
> seem to work. =A0I can ssh from the command line to port 3007 of this rou=
ter
> 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
>
>


More information about the Trilug-ontopic mailing list