mageni veni vidi ridi | Bonjour,
J'aimerais créer une connexion SSH avec le protocole 2 d'une machine Windows vers une machine UNIX via le système clef privé/publique.
Pour cela j'ai donc créé un jeu de clef (id_dsa, id_dsa.pub) et j'ai renseigné le code perl suivant :
Code :
- use strict;
- use Net::SSH::Perl;
- #use Math::Pari;
- #use lib "H:\\TASKS\\TOOLS\\Perl\\lib\\Math";
- my @id = ("id_dsa" ); #<<<< la fameuse clef privée
- my %params = (
- port => 22,
- protocol => 2,
- interactive => 0,
- identity_files => [@id],
- debug => 3,
- options => [
- "BatchMode yes",
- "AuthenticationSuccessMsg no",
- "ForwardX11 no",
- "ForwardAgent no"
- ]
- );
- my $host = "la_machine_unix";
- my $username = "un_utilisateur_valide";
- my $ssh = Net::SSH::Perl->new($host, %params); #<<<< la connection
- $ssh->login($username);
- my $cmd = "pwd";
- my $data = $ssh->cmd($cmd);
- print $data;
|
ET la je tombe sur une erreur m'indiquant qu'il me manque le paquet Net::SSH:Perl.
Pour l'installer, je tape donc en ligne de commande dans un shell : ppm install Net-SSH-Perl.
J'obtiens l'affichage suivant :
Code :
- C:\Documents and Settings\mageni>ppm install Net-SSH-Perl
- Syncing site PPM database with .packlists...done
- Syncing perl PPM database with .packlists...done
- Downloading Net-SSH-Perl-1.23...done
- Downloading Crypt-DH-0.06...done
- Downloading Math-Pari-2.01080604...done
- Downloading Crypt-IDEA-1.08...done
- Downloading Convert-PEM-0.08...done
- Downloading String-CRC32-1.4...done
- Downloading Math-GMP-2.06...done
- Downloading Digest-MD5-2.51...done
- Downloading Digest-HMAC-1.02...done
- Downloading Crypt-DSA-1.16...done
- Downloading Digest-SHA1-2.13...done
- Downloading MIME-Base64-3.13...done
- Downloading Math-BigInt-1.993...done
- Downloading Crypt-DES_EDE3-0.01...done
- Downloading Convert-ASN1-0.22...done
- Downloading Class-ErrorHandler-0.01...done
- Downloading Crypt-DES-2.05...done
- Unpacking Net-SSH-Perl-1.23...done
- Unpacking Crypt-DH-0.06...done
- Unpacking Math-Pari-2.01080604...done
- Unpacking Crypt-IDEA-1.08...done
- Unpacking Convert-PEM-0.08...done
- Unpacking String-CRC32-1.4...done
- Unpacking Math-GMP-2.06...done
- Unpacking Digest-MD5-2.51...done
- Unpacking Digest-HMAC-1.02...done
- Unpacking Crypt-DSA-1.16...done
- Unpacking Digest-SHA1-2.13...done
- Unpacking MIME-Base64-3.13...done
- Unpacking Math-BigInt-1.993...done
- Unpacking Crypt-DES_EDE3-0.01...done
- Unpacking Convert-ASN1-0.22...done
- Unpacking Class-ErrorHandler-0.01...done
- Unpacking Crypt-DES-2.05...done
- Generating HTML for Net-SSH-Perl-1.23...done
- Updating files in site area...done
- 123 files installed
|
tout semble bien se passer, je vais dans C:\Temp ou je localise un dossier : "perl------------please-run-the-install-script------------"
Et la petit soucis, rien de type .exec,.bat, etc...
Du coup, je cherche un peu et on me dit qu'il suffit de copier les fichiers contenus dans C:\Temp\perl------------please-run-the-install-script------------\site\lib
à la bonne place dans ma lib perl :"Perl\lib"
Je copie les dits fichiers, puis lance mon test.pl contenant le précédant code.
Et là, j'obtiens les erreurs suivantes :
Code :
- C:\Documents and Settings\mageni>perl "C:\[..]\tests\test.pl"
- dk239023: Reading configuration data /.ssh/config
- dk239023: Reading configuration data /etc/ssh_config
- dk239023: Connecting to la_machine_unix, port 22.
- dk239023: Remote protocol version 2.0, remote software version Sun_SSH_1.1
- Can't locate loadable object for module Math::Pari in @INC (@INC contains: H:/TASKS/TOOLS/Perl/site/lib H:/TASKS/TOOLS/Perl/lib .) at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl/Util/SSH2MP.pm line 6
- Compilation failed in require at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl/Util/SSH2MP.pm line 6, <GEN0> line 1.
- BEGIN failed--compilation aborted at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl/Util/S
- SH2MP.pm line 6, <GEN0> line 1.
- Compilation failed in require at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl/Util.pm line 56, <GEN0> line 1.
- BEGIN failed--compilation aborted at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl/Kex/DH1.pm line 10, <GEN0> line 1.
- Compilation failed in require at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
- BEGIN failed--compilation aborted at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl/Kex.pm line 6, <GEN0> line 1.
- Compilation failed in require at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl/SSH2.pm line 6, <GEN0> line 1.
- BEGIN failed--compilation aborted at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl/SSH2.pm line 6, <GEN0> line 1.
- Compilation failed in require at H:/TASKS/TOOLS/Perl/lib/Net/SSH/Perl.pm line 52, <GEN0> line 1.
|
Bizarre car j'ai bien le fichier Pari.pm dans le dossier Perl\lib\Math.
J'ouvre le fichier Pari.pm, et, diable, voilà qui est bien bizarre : http://cpansearch.perl.org/src/ILY [...] 09/Pari.pm
Du coup je me dis qu'il y a eu une erreur lors de l'installation du package, je regarde le ppm4.log et j'obtiens les erreurs suivantes :
Code :
- 2011-04-04T11:08:15 <7> [InstallArea.pm:454] unlink C:/TEMP/perl------------please-run-the-install-script------------/site/etc/ppm-site-dirty
- 2011-04-04T11:08:16 <4> [ppm:13] cannot unlink file for C:\Temp\ppm-QvI3Io\Net-SSH-Perl-1.23\blib\html\site\lib\Net\SSH\Perl.html: Permission denied at H:/TASKS/TOOLS/Perl/lib/ActivePerl/PPM/Client.pm line 1307
- 2011-04-04T11:08:16 <4> [ppm:13] cannot remove directory for C:\Temp\ppm-QvI3Io\Net-SSH-Perl-1.23\blib\html\site\lib\Net\SSH: Directory not empty at H:/TASKS/TOOLS/Perl/lib/ActivePerl/PPM/Client.pm line 1307
- 2011-04-04T11:08:16 <4> [ppm:13] cannot remove directory for C:\Temp\ppm-QvI3Io\Net-SSH-Perl-1.23\blib\html\site\lib\Net: Directory not empty at H:/TASKS/TOOLS/Perl/lib/ActivePerl/PPM/Client.pm line 1307
- 2011-04-04T11:08:16 <4> [ppm:13] cannot remove directory for C:\Temp\ppm-QvI3Io\Net-SSH-Perl-1.23\blib\html\site\lib: Directory not empty at H:/TASKS/TOOLS/Perl/lib/ActivePerl/PPM/Client.pm line 1307
- 2011-04-04T11:08:16 <4> [ppm:13] cannot remove directory for C:\Temp\ppm-QvI3Io\Net-SSH-Perl-1.23\blib\html\site: Directory not empty at H:/TASKS/TOOLS/Perl/lib/ActivePerl/PPM/Client.pm line 1307
- 2011-04-04T11:08:16 <4> [ppm:13] cannot remove directory for C:\Temp\ppm-QvI3Io\Net-SSH-Perl-1.23\blib\html: Directory not empty at H:/TASKS/TOOLS/Perl/lib/ActivePerl/PPM/Client.pm line 1307
- 2011-04-04T11:08:16 <4> [ppm:13] cannot remove directory for C:\Temp\ppm-QvI3Io\Net-SSH-Perl-1.23\blib: Directory not empty at H:/TASKS/TOOLS/Perl/lib/ActivePerl/PPM/Client.pm line 1307
- 2011-04-04T11:08:16 <4> [ppm:13] cannot remove directory for C:\Temp\ppm-QvI3Io\Net-SSH-Perl-1.23: Directory not empty at H:/TASKS/TOOLS/Perl/lib/ActivePerl/PPM/Client.pm line 1307
- 2011-04-04T11:08:16 <4> [ppm:13] cannot remove directory for C:\Temp\ppm-QvI3Io: Directory not empty at H:/TASKS/TOOLS/Perl/lib/ActivePerl/PPM/Client.pm line 1307
|
J'ai essayé de recompiler Pari sans succès :
Code :
- C:\Documents and Settings\mageni>perl "C:\Documents and Settings\mageni\Desk
- top\Math-Pari-2.01080604\Makefile.PL" paridir="C:\Documents and Settings\mageni\Desktop\pari-2.3.0"
- Set up gcc environment - 3.4.5 (mingw-vista special r3)
- Setting up Math::Pari with Perl 5.012003 on MSWin32 version 5.2;
- cc=H:/TASKS/TOOLS/Perl/site/bin/gcc.exe, gccversion=3.4.5 (mingw-vista specia
- l r3), cccdlflags=' ',
- ccflags='-DNDEBUG -DWIN32 -D_CONSOLE -DNO_STRICT -DHAVE_DES_FCRYPT -DUSE_SITE
- CUSTOMIZE -DPERL_IMPLICIT_CONTEXT -DPERL_IMPLICIT_SYS -DUSE_PERLIO -D_USE_32BIT_
- TIME_T -DPERL_MSVCRT_READFIX -DHASATTRIBUTE -fno-strict-aliasing -mms-bitfields'
- ,
- optimize='-O2',
- ld=H:\TASKS\TOOLS\Perl\site\bin\g++.exe, ldflags='-L"C:\TEMP\perl------------
- please-run-the-install-script------------\lib\CORE"'.
- Found GP/PARI build directory in C:\Documents and Settings\rpallier\Desktop\pari
- -2.3.0
- (integer-formatted version 2003000).
- ### Math::Pari support of GP/PARI library version 2.3.* is not fully
- ### finished. For non-PS plotting functions, one must downgrade to 2.1.7.
- ### Moreover, the test t/55_intnum.t takes significant time to complete.
- The system cannot find the path specified.
- Could not run test converter: No such file or directory 256 at H:/TASKS/TOOLS/Pe
- rl/lib/Math/PariBuild.pm line 627.
|
voilà où j'en suis, si quelqu'un pense savoir où j'ai mal géré, se sera avec joie que je recevrais les critiques . Message édité par mageni le 06-04-2011 à 11:38:59
|