SSH::Command - interface to execute multiple commands on host by SSH protocol without certificates ( only login + password )
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) { print "all ok!"; } else { print "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 );
To install SSH::Command, copy and paste the appropriate command in to your terminal.
cpanm
cpanm SSH::Command
CPAN shell
perl -MCPAN -e shell install SSH::Command
For more information on module installation, please visit the detailed CPAN module installation guide.