List Info

Thread: SSH session to Cisco device




SSH session to Cisco device
country flaguser name
United Kingdom
2007-06-26 01:56:01
Hi Guys,

Nigel from Stafford here (long time lurker on the
Birmingham.pm list).

I wonder if any of you guys can help me out...?

I am trying to pull together a script to open up an
interactive SSH session 
to a Cisco Wireless Controller in a DMZ on a network that
I'm working on.

My environment is very constrained : I must put the script
on a Windows 2003 
server with Activestate perl.

I have already pulled together a script that Telnets (using
Net::Telnet) to 
the controller and makes the config changes required, no
probs. But, when I 
try to do the same thing using SSH, this is where the fun
begins....

I have been looking at Net::SSH::Perl, which I managed to
find some ppd's 
for (and installed), but I'm having a difficult time
figuring out how to get 
an interactive session going to send commands/parse for
prompts etc.

I also looked at Net::Appliance::Session, but can't find any
ppd's for this 
module anywhere....

Net::Telnet has a really nice example of opening up a new
pseudo terminal 
and forking ssh, but I'm not quite sure how that would
translate to a 
Windows environment.

I've had a good look around in perl mongers etc, but this
seems to be quite 
a issue for a lot of people.

So, I guess what I'm asking is, as anyone out there got any
other solutions 
that they've managed to get going (for SSH2) in this type of
environment ? 
Or, any other suggestions ?

Thanks

Nigel.



Re: SSH session to Cisco device
user name
2007-06-26 02:21:02
Hi,

I'd probably use putty in some way shape or form.  It does
support
command line options like the normal ssh command.  I'm not
sure how
easy it is to do an interactive session but worst case you
could do
something like this keep alive done in perl.

http://www.p
erlmonks.org/?node_id=482992


Colin.

On 6/26/07, Nigel Bowden <nbowdendsl.pipex.com> wrote:
> Hi Guys,
>
> Nigel from Stafford here (long time lurker on the
Birmingham.pm list).
>
> I wonder if any of you guys can help me out...?
>
> I am trying to pull together a script to open up an
interactive SSH session
> to a Cisco Wireless Controller in a DMZ on a network
that I'm working on.
>
> My environment is very constrained : I must put the
script on a Windows 2003
> server with Activestate perl.
>
> I have already pulled together a script that Telnets
(using Net::Telnet) to
> the controller and makes the config changes required,
no probs. But, when I
> try to do the same thing using SSH, this is where the
fun begins....
>
> I have been looking at Net::SSH::Perl, which I managed
to find some ppd's
> for (and installed), but I'm having a difficult time
figuring out how to get
> an interactive session going to send commands/parse for
prompts etc.
>
> I also looked at Net::Appliance::Session, but can't
find any ppd's for this
> module anywhere....
>
> Net::Telnet has a really nice example of opening up a
new pseudo terminal
> and forking ssh, but I'm not quite sure how that would
translate to a
> Windows environment.
>
> I've had a good look around in perl mongers etc, but
this seems to be quite
> a issue for a lot of people.
>
> So, I guess what I'm asking is, as anyone out there got
any other solutions
> that they've managed to get going (for SSH2) in this
type of environment ?
> Or, any other suggestions ?
>
> Thanks
>
> Nigel.
>
>
>

Re: SSH session to Cisco device
user name
2007-06-26 03:08:43
On 26/06/07, Nigel Bowden <nbowdendsl.pipex.com> wrote:
>
>
> I also looked at Net::Appliance::Session, but can't
find any ppd's for
> this
> module anywhere....


It's pure Perl so you should be able to simply download

http://search.cpan.org/CPAN/
authors/id/O/OL/OLIVER/Net-Appliance-Session-0.13.tar.gz


and follow the instructions in

http://search.cpan.org/src/OLIVER/Net-Applia
nce-Session-0.13/INSTALL

You'll need to change 'make' to 'nmake' and get hold of
Microsoft's
nmake.exe (free download) if it's not already installed. (Is
it standard in
XP yet?)

Re: SSH session to Cisco device
country flaguser name
United Kingdom
2007-06-26 04:50:23
Colin/Brian,

Thanks for the suggestions, I really appreciate you taking
the time to look 
at this.

I have already tried to build the Net::Appliance::Session
myself, but that 
was with a version of perl I compiled myself (which I
usually use) and had 
some dependancy issues with some of the encryption modules
not building.

I think I'll see if I can get all the dependancies in place
with the 
Activestate version of perl and then, like you suggest,
build with nmake.

I'll let you know how I get on....

I've also thought about maybe trying the hack suggested in
the Net::Telnet 
pod doc for SSH, but maybe using OpenSSH. But, I guess I'd
have to maybe 
start a new thread with OpenSSH running and redirect the I/O
from the thread 
to Net::Telnet. Again, I'll let you know

Thanks.

Nigel.

----- Original Message ----- 
From: "Brian McCauley" <nobull67gmail.com>
To: "Birmingham Perl Mongers mailing list"
<birmingham-pmpm.org>
Sent: Tuesday, June 26, 2007 9:08 AM
Subject: Re: SSH session to Cisco device


> On 26/06/07, Nigel Bowden <nbowdendsl.pipex.com> wrote:
>>
>>
>> I also looked at Net::Appliance::Session, but can't
find any ppd's for
>> this
>> module anywhere....
>
>
> It's pure Perl so you should be able to simply
download
>
> http://search.cpan.org/CPAN/
authors/id/O/OL/OLIVER/Net-Appliance-Session-0.13.tar.gz

>
> and follow the instructions in
>
> http://search.cpan.org/src/OLIVER/Net-Applia
nce-Session-0.13/INSTALL
>
> You'll need to change 'make' to 'nmake' and get hold of
Microsoft's
> nmake.exe (free download) if it's not already
installed. (Is it standard 
> in
> XP yet?) 


[1-4]

about | contact  Other archives ( Real Estate discussion Medical topics )