Beefy Boxes and Bandwidth Generously Provided by pair Networks
laziness, impatience, and hubris
 
PerlMonks  

Re^2: help to deal with ssh connection

by mitchreward (Acolyte)
on May 18, 2014 at 22:28 UTC ( [id://1086563]=note: print w/replies, xml ) Need Help??


in reply to Re: help to deal with ssh connection
in thread help to deal with ssh connection

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.

Replies are listed 'Best First'.
Re^3: help to deal with ssh connection
by salva (Canon) on May 19, 2014 at 08:20 UTC
    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.

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://1086563]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others contemplating the Monastery: (3)
As of 2025-07-20 02:50 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?
    erzuuliAnonymous Monks are no longer allowed to use Super Search, due to an excessive use of this resource by robots.