ssh thru perl

Posted on 2004-11-19
Last Modified: 2012-05-05
My requirement.
i m running my script from server under the directory /u/rshah1/
in my perl script i want to do ssh and there is a file in the directory /v/temp
is it possible to do in

when i do ssh in perl script and run my scipt it does the ssh and my console get transferred to i cannot execute anything after ssh

so i want to run a script that resides on different server.

Question by:shahrahulb
    LVL 13

    Expert Comment

    You'll need to use the Net::SSH perl module to do this..
    LVL 1

    Author Comment

    no need for net::ssh

    system(ssh xxx) worked for me also i did sshykeygen so that i don't have to enter password.

    LVL 48

    Accepted Solution

    system "ssh /v/temp/" and die "Can not run ssh $!\n";

    Featured Post

    What Is Threat Intelligence?

    Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

    Join & Write a Comment

    I've just discovered very important differences between Windows an Unix formats in Perl,at least 5.xx.. MOST IMPORTANT: Use Unix file format while saving Your script. otherwise it will have ^M s or smth likely weird in the EOL, Then DO NOT use m…
    Many time we need to work with multiple files all together. If its windows system then we can use some GUI based editor to accomplish our task. But what if you are on putty or have only CLI(Command Line Interface) as an option to  edit your files. I…
    Explain concepts important to validation of email addresses with regular expressions. Applies to most languages/tools that uses regular expressions. Consider email address RFCs: Look at HTML5 form input element (with type=email) regex pattern: T…
    It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.

    755 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    23 Experts available now in Live!

    Get 1:1 Help Now