From my laptop, I'm trying to copy a directory of files from one Raspberry Pi (
firstname.lastname@example.org) to another (
~/example$ scp -r email@example.com:~/example/files_to_send firstname.lastname@example.org:~/example
but I keep getting this error message after I enter the password for
email@example.com (the host from which the directory is to be copied):
firstname.lastname@example.org's password: Permission denied, please try again. Permission denied, please try again. Permission denied (publickey,password). lost connection
I've tried deleting the ECDSA fingerprints in
~/.ssh/known_hosts for each of the devices, and generating new ones by reconnecting each host together again with
ssh. I have also ensured that the home directories (and all their contents) have the correct permissions, owner and group.
Also, if access the Raspberry Pi that I'm trying to copy from (
ssh, and do the following:
~/example$ scp - r files_to_send email@example.com:~/example
It works fine.
I'd like to know why using
scp to copy from a remote host to another remote host isn't working.
I discovered the
-v option for
scp ; here its entry in the
Verbose mode. Causes scp and ssh(1) to print debugging messages about their progress. This is helpful in debugging connection, authentication, and configuration problems.
So, I added this to the command, and this indicates that the authentication to
firstname.lastname@example.org is successful. However, when
email@example.com later attempts to authenticate to
firstname.lastname@example.org, the following messages are printed and the connection fails:
debug1: read_passphrase: can't open /dev/tty: No such device or address Host key verification failed. lost connection