NAME
SSH::Command - interface to execute multiple commands on host by SSH protocol without certificates ( only login + password )
SYNOPSIS
use
SSH::Command;
my
$result
= ssh_execute(
host
=>
'127.0.0.1'
,
username
=>
'suxx'
,
password
=>
'qwerty'
,
commands
=>
[
{
cmd
=>
'uname -a'
,
# for check connection
verify
=>
qr/linux/
i,
# or => 'linux-....' (check by 'eq')
}
]
);
if
(
$result
) {
"all ok!"
;
}
else
{
"Command failed!"
;
}
Execute one command and get answer:
my
$command_answer_as_text
= ssh_execute(
host
=>
'127.0.0.1'
,
username
=>
'suxx'
,
password
=>
'qwerty'
,
command
=>
'uname'
,
# for check connection
);