How to foce SCP to create a directory ????????????? - SSH

This is a discussion on How to foce SCP to create a directory ????????????? - SSH ; Is there a way to force scp to create a directory if it does not exist when copying a file remotely scp -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/ authorized_keys ring1@$hostname:~/.ssh /authorized_keys gerb...

+ Reply to Thread
Results 1 to 9 of 9

Thread: How to foce SCP to create a directory ?????????????

  1. How to foce SCP to create a directory ?????????????


    Is there a way to force scp to create a directory if it does not exist
    when copying a file remotely

    scp -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    authorized_keys ring1@$hostname:~/.ssh/authorized_keys

    gerb


  2. Re: How to foce SCP to create a directory ?????????????

    On Mon, 10 Sep 2007 06:57:54 -0700, gerry.brennan wrote:

    > Is there a way to force scp to create a directory if it does not exist
    > when copying a file remotely
    >
    > scp -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    > authorized_keys ring1@$hostname:~/.ssh/authorized_keys
    >


    Have you tried with -r?



  3. Re: How to foce SCP to create a directory ?????????????

    On Sep 10, 3:08 pm, "K. Jennings" wrote:
    > On Mon, 10 Sep 2007 06:57:54 -0700, gerry.brennan wrote:
    > > Is there a way to force scp to create a directory if it does not exist
    > > when copying a file remotely

    >
    > > scp -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    > > authorized_keys ring1@$hostname:~/.ssh/authorized_keys

    >
    > Have you tried with -r?


    yes I have tried

    scp -r -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    authorized_keys ring1@$hostname:~/.ssh/authorized_keys

    No joy


  4. Re: How to foce SCP to create a directory ?????????????

    On Sep 10, 3:44 pm, gerry.bren...@gmail.com wrote:
    > On Sep 10, 3:08 pm, "K. Jennings" wrote:
    >
    > > On Mon, 10 Sep 2007 06:57:54 -0700, gerry.brennan wrote:
    > > > Is there a way to force scp to create a directory if it does not exist
    > > > when copying a file remotely

    >
    > > > scp -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    > > > authorized_keys ring1@$hostname:~/.ssh/authorized_keys

    >
    > > Have you tried with -r?

    >
    > yes I have tried
    >
    > scp -r -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    > authorized_keys ring1@$hostname:~/.ssh/authorized_keys
    >
    > No joy


    What would be even better if i could overwrite the directory and
    remove any of its contents with a singel scp command.


  5. Re: How to foce SCP to create a directory ?????????????

    On Mon, 10 Sep 2007 07:44:12 -0700, gerry.brennan wrote:

    > On Sep 10, 3:08 pm, "K. Jennings" wrote:
    >> On Mon, 10 Sep 2007 06:57:54 -0700, gerry.brennan wrote:
    >> > Is there a way to force scp to create a directory if it does not
    >> > exist when copying a file remotely

    >>
    >> > scp -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    >> > authorized_keys ring1@$hostname:~/.ssh/authorized_keys

    >>
    >> Have you tried with -r?

    >
    > yes I have tried
    >
    > scp -r -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    > authorized_keys ring1@$hostname:~/.ssh/authorized_keys
    >


    You can get the whole directory created if you do:

    scp -r -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh
    ring1@hostname:

    But, this would also transfer all the contents of ~/.ssh. I
    assume that this is not hat you want, right?


  6. Re: How to foce SCP to create a directory ?????????????

    On 10 Sep, 14:57, gerry.bren...@gmail.com wrote:
    > Is there a way to force scp to create a directory if it does not exist
    > when copying a file remotely
    >
    > scp -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    > authorized_keys ring1@$hostname:~/.ssh/authorized_keys
    >
    > gerb


    I think you should either send a preliminary "mkdir" command, or use
    rsync something like this:

    rsync -avv --include=authorized_keys -e 'ssh -o
    stricthostkeychecking=no -oCiphers=aes128-cbc' ~/.ssh/ ring1@
    $hostname:.ssh/


  7. Re: How to foce SCP to create a directory ?????????????

    On 10 Sep, 19:55, Nico wrote:
    > On 10 Sep, 14:57, gerry.bren...@gmail.com wrote:
    >
    > > Is there a way to force scp to create a directory if it does not exist
    > > when copying a file remotely

    >
    > > scp -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    > > authorized_keys ring1@$hostname:~/.ssh/authorized_keys

    >
    > > gerb

    >
    > I think you should either send a preliminary "mkdir" command, or use
    > rsync something like this:
    >
    > rsync -avv --include=authorized_keys -e 'ssh -o
    > stricthostkeychecking=no -oCiphers=aes128-cbc' ~/.ssh/ ring1@
    > $hostname:.ssh/


    rsync is not available on the machine


  8. Re: How to foce SCP to create a directory ?????????????

    On 11 Sep, 14:23, gerry.bren...@gmail.com wrote:

    > rsync is not available on the machine- Hide quoted text -


    OK, so SCP is enabled without shell access? Which particular approach
    to that is in use, and are you *sure* rsync isn't installed? I've seen
    cases where the admins didn't realize it was there.



  9. Re: How to foce SCP to create a directory ?????????????

    On Tue, Sep 11, 2007 at 06:23:36AM -0700, gerry.brennan@gmail.com wrote:
    > On 10 Sep, 19:55, Nico wrote:
    > > On 10 Sep, 14:57, gerry.bren...@gmail.com wrote:
    > >
    > > > Is there a way to force scp to create a directory if it does not exist
    > > > when copying a file remotely

    > >
    > > > scp -o stricthostkeychecking=no -oCiphers=aes128-cbc ~/.ssh/
    > > > authorized_keys ring1@$hostname:~/.ssh/authorized_keys

    > >
    > > > gerb

    > >
    > > I think you should either send a preliminary "mkdir" command, or use
    > > rsync something like this:
    > >
    > > rsync -avv --include=authorized_keys -e 'ssh -o
    > > stricthostkeychecking=no -oCiphers=aes128-cbc' ~/.ssh/ ring1@
    > > $hostname:.ssh/

    >
    > rsync is not available on the machine
    >


    Just cat it thought ssh...

    cat ~/.ssh/authorized_keys | ssh ring1@$hostname "mkdir -m 0700 -p \
    ..ssh && cat - >> .ssh/authorized_keys && chmod 0622 \
    ..ssh/authorized_keys"

    --
    Martin

+ Reply to Thread