"scp - r" need password, why?

clone: Command “scp -r openserver:/var/lib/one//datastores/1/5ce82c0baaff1ba6b86c09e59da49873 192.168.137.128:/var/lib/one//datastores/0/10/disk.0” failed: Permission denied, please try again.
Tue Oct 4 00:10:57 2016 [Z0][TM][I]: Permission denied, please try again.
Tue Oct 4 00:10:57 2016 [Z0][TM][I]: Permission denied (publickey,gssapi-keyex,gssapi-with-mic,password).
Tue Oct 4 00:10:57 2016 [Z0][TM][E]: Error copying openserver:/var/lib/one//datastores/1/5ce82c0baaff1ba6b86c09e59da49873 to 192.168.137.128:/var/lib/one//datastores/0/10/disk.0
Tue Oct 4 00:10:57 2016 [Z0][TM][I]: ExitCode: 1
Tue Oct 4 00:10:57 2016 [Z0][TM][E]: Error executing image transfer script: Error copying openserver:/var/lib/one//datastores/1/5ce82c0baaff1ba6b86c09e59da49873 to 192.168.137.128:/var/lib/one//datastores/0/10/disk.0
Tue Oct 4 00:10:57 2016 [Z0][VM][I]: New LCM state is PROLOG_FAILURE

[oneadmin @ openserver ~] $SSH open - 1 Last login: Tue Oct 4 00:40:21 2016 from openserver
[oneadmin@openserver ~]$ scp -r openserver:/var/lib/one/datastores/1 open-1:/var/lib/one/test
oneadmin@openserver’s password:

don’t need to enter a password, but the scp -r need to enter a password, such as using CLI operation would be prompted for a password, why?

Hi!
the scp command is trying to copy from openserver to open-1 doing this:

  • opens an ssh session with openserver and copy the files
  • opens an ssh session with open-1 and copy those files in the destination folder

So two servers are implied in this scp command. So you have to be sure that you can do:
[oneadmin@openserver ~]$ ssh openserver
without password (maybe you have to copy the id_rsa.pub content to the authorized_keys file in /var/lib/one/.ssh folder in openserver), that way OpenNebula’s copy operation can be executed

As users we usually use scp coommand like scp file user@remote_server so only one ssh connection is opened but OpenNebula uses scp in that way using both the source server and the destiny server.

Hope I have explained myself :slight_smile:

Cheers!

Very useful, thank you