I am doing a file copy from a Smartphone to a Privat Cloud Server, from this to a Debian Server (on premise at home).
The Debian Server has established a permanent Reverse Tunnel by autossh to the Privat Cloud Server.
The file copy works fine when using the following two command steps:
Copy photo from Smartphone to Private Cloud Server:
scp -i /home/.ssh/id_rsa_1 -P 5022 /storage/DCIM/Camera/20201128_212840.jpg user_1@private_cloud.com:/tmp/
Login at Private Cloud Server and copy from Private Cloud Server to Debian-Server on Premise:
ssh -i /home/.ssh/id_rsa_1 -p 5022 user_1@private_cloud.com 'scp -i /home/user_2/.ssh/id_rsa_2 -P 6022 /tmp/20201128_212840.jpg user_2@localhost:/home/user_2/tmp/'
As this method (of a two step copy within two command lines) is too much time consuming, I am now looking for doing the copy within "one strike" (only using one command line), probably the actual time needed can be reduced dramatically when one ssh login at the Private Cloud can be eliminated.
Any help is appreciated.
Best regards