Say, now you are going to copy a few files from a remote server to another. As usual, your remote_server_1 should be given the credentials to copy files to remote_server_2.
root@node2:~# scp -P 1984 -r /mnt/patches firstname.lastname@example.org:/mnt/patches
Usually, your computer key must already have given the required permissions to access those remote locations. But since the access is not given to remote_server_1, it will prompt for the password of remote_server_2.
As a quick fix, you can copy the private key from your local computer to remote_location_1. However, further discussion on the security concerns on doing this can be found on the web.
scp -P 1984 ~/.ssh/id_rsa email@example.com:~/
Now if you encounter the below when trying,
root@node2:~# scp -P 1984 -r -i id_rsa /mnt/patches firstname.lastname@example.org:/mnt/patches ssh_exchange_identification: Connection closed by remote host lost connection
Have a look into the denied and accessed hosts of remote_server_2, and make sure that the ip of remote_server_2 is allowed and not denied.
vim /etc/hosts.deny vim /etc/hosts.allow #sshd sshd1 sshd2 : ALL : ALLOW sshd: 184.108.40.206
Now, the scp command given above, should work as expected to copy the files from the remote_server_1 to remote_server_2.