Beefy Boxes and Bandwidth Generously Provided by pair Networks
There's more than one way to do things

Re: Execute Perl script on Remote server without any CPAN module

by FloydATC (Deacon)
on Jan 29, 2014 at 11:10 UTC ( #1072480=note: print w/replies, xml ) Need Help??

in reply to Execute Perl script on Remote server without any CPAN module

... 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.

-- FloydATC

Time flies when you don't know what you're doing

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://1072480]
and all is quiet...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (10)
As of 2018-01-23 14:07 GMT
Find Nodes?
    Voting Booth?
    How did you see in the new year?

    Results (246 votes). Check out past polls.