[Dub-pm] Perl & SSH

John Tobin tobinjt at netsoc.tcd.ie
Fri Mar 11 05:43:12 PST 2005

On Fri, Mar 11, 2005 at 12:38:13PM +0000, Dave Burke wrote:
> It was working great until we started turning off telnet on certain
> routers, so I now need to upgrade it to talk to the routers via ssh.

> I'd prefer to just add to the existing script, so I've been looking at
> the various ways that perl & ssh work.
> Net::SSH
> 	Good: libnet-ssh-perl package for debian, so I dont have to build any
> modules
> 	Bad: doesn't support passwords.
> Net::SSH::Perl
> 	Good: Supports passwords
> 	Bad: No deb package && lots of dependencies for building the module
> Or, would I be better off just using something like Expect.pm?

I've written code to talk to Cisco boxes, and I'd suggest using
Expect.pm.  Net::SSH doesn't support passwords, and Cisco's crap SSH
implementation doesn't support keys.  Net::SSH::Perl does support
passwords, but I couldn't get it to talk to Cisco's SSH - it couldn't
negotiate a common set of capabilities or something.  Try something like
	autoexpect -p ssh -1 -4 -x -a -e none system at router
and convert the resulting Expect script to Perl + Expect.pm.

John Tobin
"It would be skewed and bias [sic] to only quote people that are
anti-Linux or anti-open source. I have done this for years, and will
continue to do so . . . "
		     -- Kenneth Brown, Alexis de Tocqueville Institution

More information about the Dublin-pm mailing list