Am using Net::SSH2 module in my Perl script and trying to make an executable (.exe for windows) using Par::Packer. The script need to ssh to a linux box from a windows box using public keys and don't want to input password.
Am facing the below error while running the .exe
Can't load 'C:\Users...\AppData\Local\Temp\par-73656172756d7567616d\cache-a6d57d5a234829aae84d08c4a78a09ad307ea8d3\a9057da2.xs.dll' for module Net::SSH2: load_file:The specified module could not be found at C:/Strawberry/perl/lib/DynaLoader.pm line 193. at C:/Strawberry/perl/vendor/lib/PAR/Heavy.pm line 123.
Tried to workaround with the below methods but none of them worked
- Tried to pack from a portable version of Strawberry Perl
- Tried to link a9057da2.xs.dll while packing using Par::Packer
Is there any workaround or fix for packing the perl scrip to .exe with Net:SSH2. Or are there alternatives to Net::SSH2 for ssh from windows to Linux using public keys (not passing passwords)?
If you get something like:
then add the following test code
(check your path to Listdlls.exe and fix the below as needed)
The Listdlls.exe is from Microsoft - see SysInternals \
First, double-click Listdlls.exe to accept the disclaimer
(will ask for approval on first launch).
When you run the Perl script, you will get something like this:
if you build your EXE and run it, you will get something like:
The last four are the missing DLLs -
add them with
--link
parameters: