scp - copy between two remote machines?

  1. scp person1@10.10.10.1:file1 person2@10.10.10.2:file1
  2. scp file1 person1@10.10.10.1:file1

For #1, I keep getting this error:
Password:
Host key verification failed.
lost connection

I have entered the correct password too!

#2 works fine. I suppose I cannot copy a file between two remote machines?

why dont you do this

SSH=/usr/local/bin/ssh
$SSH person1@10.10.10.1 scp /location/file1 person2@10.10.10.2:/location/file1

Password:
Host key verification failed.
lost connection

Same problem. I suppose you can't copy files between two remote machines but you only copy files between a local machine and a remote machine?

scp from remote systems is possible..

syst1# scp syst2:/tmp/tst123 syst3:/tmp/tst1234
syst1# ssh syst2 ls -al /tmp/tst123
-rw-r--r--   1 root     root          23 Feb  5 13:22 /tmp/tst123
syst1# ssh syst3 ls -al /tmp/tst1234
-rw-r--r--   1 root     root          23 Feb  5 13:29 /tmp/tst1234
syst1#

In this example the user is able to ssh to the servers without a password.

I tried with 2 different users and I got a different error to yours.

syst1# scp user1@syst2:/tmp/tst123 user2@syst3:/tmp/tst12345
Password:
Permission denied (gssapi-keyex,gssapi-with-mic,publickey,keyboard-interactive).
lost connection
syst1#

I have verified that the passwords are correct for both users via an ssh connection.

Does the following work fine, without any error ?

ssh person1@10.10.10.1
ssh person2@10.10.10.2

I have found that if the user can ssh without being prompted for a password it will work fine.

[quote=tornado]
scp from remote systems is possible..

syst1# scp syst2:/tmp/tst123 syst3:/tmp/tst1234
syst1# ssh syst2 ls -al /tmp/tst123
-rw-r--r--   1 root     root          23 Feb  5 13:22 /tmp/tst123
syst1# ssh syst3 ls -al /tmp/tst1234
-rw-r--r--   1 root     root          23 Feb  5 13:29 /tmp/tst1234
syst1#

In this example the user is able to ssh to the servers without a password.

QUOTE]

For this example, do you have .rhosts files and/or hosts.equiv configured? Maybe that's why it worked between two remote file systems without providing passwords?

So your last example didn't work? I had that error too. It's weird sometimes I get that error.

So how exactly do I use scp between two remote file systems by providing the passwords?

.rhosts is for rsh not for ssh