Re: Multiple modes? throught one connection

From: Darren Tucker (
Date: 09/15/04

  • Next message: Edwin: "mmap failure (???) causes my SSH installation to not work?"
    Date: Wed, 15 Sep 2004 21:01:58 +1000
    To: Tim Nelson <>

    Tim Nelson wrote:
    > Hi all. I often want to scp a file somewhere and then run it. At
    > the moment, I have to do an scp followed by an ssh (in a script) so I
    > need to type the password twice. Is there a way of linking the two
    > together somehow so that it will, through the one connection, trnasfer
    > the file, and then run the command? If so, is there somewhere that I
    > can find documentation on how to do this?

    If you're using a recent OpenSSH, check the ssh(1) man page for
    ControlMaster and ControlPath.

    You don't need to scp the script to execute it, though. Try:
    $ ssh yourserver /bin/sh <

    Darren Tucker (dtucker at
    GPG key 8FF4FA69 / D9A3 86E9 7EEE AF4B B2D4  37C9 C982 80C7 8FF4 FA69
         Good judgement comes with experience. Unfortunately, the experience
    usually comes from bad judgement.

  • Next message: Edwin: "mmap failure (???) causes my SSH installation to not work?"

    Relevant Pages

    • Re: yet another question on file names with spaces?
      ... > What's echo for? ... know what they are before the script runs - see below. ... present locally, but not remotely, I copy to the remote machine via scp. ... images and pdfs which I only want to transfer once. ...
    • Re: scp and scripts?
      ... The following is basically what I want the script to do, ... >> but I heard scp will not work with authentication. ... > an SSH key of the appropriate type. ... > want a passphrase; press enter to use a blank passphrase. ...
    • RE: Script doesnt complete via Cron
      ... Assuming you are using rsa or dsa public key authentication for the ... Setting it up under root's crontab won't work - the ... I have an user account called "copy" created for scp transfers. ... Script doesn't complete via Cron ...
    • Re: Net::Scp
      ... When I run the script if I run it for just one ... the possibilities of deadlock with respect to Open3 (which is maybe what ... be the problem, as the Perl program isn't prompting for one, it is the ... scp doing that, but if the scp's pipes are being handled by the Open3 ...
    • Automatic script with crontab/ssh
      ... I am about to make a script that copies files from one Linux server ... scp to copy the files. ... scp ftp1 ... scp ftp2 ...