|Do you know where your variables are?|
Re: Execute Perl script on Remote server without any CPAN moduleby FloydATC (Deacon)
|on Jan 29, 2014 at 11:10 UTC||Need Help??|
... it seems it do not have reference to the script and can perform any other line of code after doing ssh to the specific server ...
In the absence of detailed info, I'll make a few assumptions and have some fun guessing :-)
If your script simply uses the ssh command to execute shell commands, Perl isn't really the challenge but rather how good you are at extracting information using shell one-liners. Then you can process that information in your local Perl script.
If, on the other hand, you are trying to remote into a host using ssh to execute a local copy of a Perl script, you will first have to make sure a local copy of that Perl script exists on the remote host. You will probably want to look into both "scp" (copy files via SSH)."
In either case, you'll probably want to look into how to set up password-less (key based) SSH authentication so you won't have to deal with password prompts etc. But please make sure you understand the security implications of allowing password-less authentication. I'm not saying it's worse than hard-coding passwords in a script, but you have to think it through all the same.
Time flies when you don't know what you're doing