V
vendion
I am trying to make a script that loops 26 times each time using SSH
to remote into a different machine every time and run a second
script. When I run the first one with SSH I get this error:
Permission denied at /home/e-307-20/bin/upgrader.pl line 13
I know that I can SSH into the machine because SSH alone works fine.
My code is as follows (user name and password has been replaced for
security reasons)
#!/usr/bin/perl
#upgrader.pl This is the server side of a two part perl script that
uses ssh to
#get into the lab PCs and have them run the upgrade.
use warnings;
use strict;
use Net::SSH:erl;
my $computer = '01'; #set the script for the first out of 26 computers
that use
#10.18.1.1xx ip scheme
while ($computer <= 26) {
my $ssh = Net::SSH:erl->new("10.18.1.1$computer");
$ssh->login('user', 'password');
my ($stdout, $stderr, $exit) = $ssh->cmd('upgrade.pl');
$computer ++;
}
exit 0
Any know what I am doing wrong with the authentication with the
script?
to remote into a different machine every time and run a second
script. When I run the first one with SSH I get this error:
Permission denied at /home/e-307-20/bin/upgrader.pl line 13
I know that I can SSH into the machine because SSH alone works fine.
My code is as follows (user name and password has been replaced for
security reasons)
#!/usr/bin/perl
#upgrader.pl This is the server side of a two part perl script that
uses ssh to
#get into the lab PCs and have them run the upgrade.
use warnings;
use strict;
use Net::SSH:erl;
my $computer = '01'; #set the script for the first out of 26 computers
that use
#10.18.1.1xx ip scheme
while ($computer <= 26) {
my $ssh = Net::SSH:erl->new("10.18.1.1$computer");
$ssh->login('user', 'password');
my ($stdout, $stderr, $exit) = $ssh->cmd('upgrade.pl');
$computer ++;
}
exit 0
Any know what I am doing wrong with the authentication with the
script?