1

I'd like to send one file to remote host which is defined as alias in drush.

The file is actually private ssh key, so it needs to be placed in ~/.ssh.

I've tried the following command:

drush -v rsync conf/my_rsa @remote:~/.ssh/

but then it's saying:

You will destroy data from drush@remote:'/var/www/~/.ssh/'

I don't want to destroy any existing data in my ~/.ssh.

Any workaround to that?

1
  • I know this is old, but the message is correct, you will destroy that file within the directory which is what you do below anyway. The message is a little ambiguous but it doesn't refer to all the files in the directory.
    – Christian
    Commented Jul 3, 2023 at 5:46

1 Answer 1

2

I've found the following workaround useful:

cat my_rsa | drush @remote ssh "cat > ~/.ssh/my_rsa"

It'll send content of the file directly via ssh into the file.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.