How to SSH from Perl script from windows machine to EC2 machine

只谈情不闲聊 提交于 2019-12-25 05:27:13

问题


I want to set and ssh tunnel between my windows machine and EC2 machine, I want to use perl for that, according to this documentation, I have to use ./driver.pl script which I couldn't find.

I use this string to ssh to my machine using command line.

ssh -2 -p 22 username@id-address -i keyfile.ssh -L p8600/Localhost/3306

I tried this from this post but I get this error:

my $ssh_pid= open("ssh -2 -p 22 username@id-address -i keyfile.ssh -L p8600/Localhost/3306 |") or die;

Can't use string ("ssh -2 -p 22 username@id-address"...) as a symbol ref while " strict refs" in use at .\start.pl line 39. D:\DESKTOP\JEFF_SHIH\MAPPING_FILE_GENERATOR>

how can I translate the above string to perl or fix the string above to get ride of the error. I installed Net::SSH::Tunnel

Thanks!


回答1:


Use Net::SSH::Perl to avoid tricky (on Windows!) dependencies to ssh-binaries. This module is written completely in Perl, so it should work on any platform. Net::SSH::Perl



来源:https://stackoverflow.com/questions/18023388/how-to-ssh-from-perl-script-from-windows-machine-to-ec2-machine

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!