in reply to help to deal with ssh connection

I don't think you need use Net::SSH::Perl; since you don't seem to be using it in your script, what happens when you remove that line?

The Debian package libnet-ssh-perl actually contains only the Perl module Net::SSH. I haven't yet found the Debian package for Net::SSH::Perl, you may need to install it via cpan if you want it, but I'd recommend Net::OpenSSH (and you're already using that module in your script anyway).

On Ubuntu 12.10 or Debian wheezy and upwards you can get Net::OpenSSH via the package libnet-openssh-perl (and libio-pty-perl for password auth).

If your sysadmin boss wants (you) to use Perl, then he'll have to deal with installing a few modules along the way.

Replies are listed 'Best First'.
Re^2: help to deal with ssh connection
by mitchreward (Acolyte) on May 18, 2014 at 22:28 UTC

    thanks guys, that helped me. I finnaly installed Net::SSH and I did something that is not far for working at the moment. I just got a problem with the auth with public key:

    #!/usr/bin/perl use Net::SSH qw(sshopen2); use CGI qw(:standard); use strict; use utf8; print header(); if (param("email")) { my $email = param("email"); my $date = param("date"); print <<ENDHTML; <html> <body> <h1> my script </h1> <br><br> <font color="red"> please type the date in English format, i.e : 1 +2-Apr-2014 </font><br><br> <form action="index.cgi" method="post"> <INPUT type="text" name="date" id="date"><BR><BR> <INPUT type="hidden" name="email" value="$email"> <INPUT type="submit" value="Send"> </form> ENDHTML my $user = "**user**"; my $host = "**host**"; my $cmd = "maili $email del $date"; sshopen2("$user\@$host", *READER, *WRITER, "$cmd") || die "ssh: $!"; while (<READER>) { chomp(); print "$_\n"; } close(READER); close(WRITER); }
    How can I specify to use a public key for ssh authentication? I can't get the doc, because http://search.cpan.org seems to be down at the moment.
      You can read the documentation for any module installed on your machine using the command perldoc. E.g.: perldoc Net::SSH.

      Even if perldoc is not installed (on some distribution it is packed as a separate tool), you can read the raw pod just looking at the .pm file.