I am trying to simply execute ssh login from my local machine to remote server using the Net::SSH::Perl and I am getting error "Can't locate object method "login" via package "ssh" (perhaps you forgot to load "ssh"?) at ./test5 line 13, <GEN0> line 1" and my code is given below
#! /usr/bin/perl use Net::SSH::Perl; my $host = "192.168.1.6"; my $user = "testing"; my $password = "redhat"; my $ssh = Net::SSH::Perl->new($host); ssh->login($user, $password); my($stdout, $stderr, $exit) = $ssh->cmd("ls -l /home/$user");
In reply to Net::SSH linux by karthikmbc
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |