in reply to subroutine For ssh
Hi
TNX for all comments
it was ok with this type
sub SSHApp { my ($MyIP , $MyUser , $MyPass , $MyPass2 , $command ) = @_ ; #SSH Connection to Applaince my $ssh_1 = Net::Appliance::Session->new({personality => 'ios', tr +ansport => 'SSH', host => "$MyIP",}) ; $ssh_1->connect({ username => "$MyUser", password => "$MyPass" + }) ; $ssh_1->begin_privileged({ password => "$MyPass2"}) ; print $ssh_1->cmd("$command") ; $ssh_1->end_privileged ; $ssh_1->close; }
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: subroutine For ssh
by Fletch (Bishop) on Oct 09, 2019 at 13:34 UTC |