I want to rsync to a cluster node to which I usually connect passing through another system:
Say I connect first to
ssh user@bridge
and from there to
ssh user@clusternode
Now I want to rsync from my workstation to clusternode. I do the following:
I open a ssh tunnel
ssh -L8000:clusternode:8000 user@bridge
I rsync from my workstation to clusternode
rsync -e "ssh -p8000" source user@localhost:destination
and it does not work, I get
ssh_exchange_identification: Connection closed by remote host
Why does it not work? What do I have to do?
I have found a lot of information here:
http://toddharris.net/blog/2005/10/23/rsyncing-through-an-ssh-tunnel/
I think to understand that my problem is the second authentication between the bridge and the destination, so I changed to method 2 that is also not very elegant, but it works. I would like to try method 3, but I don't know how to configure a rsync daemon
Rsync stands for "Remote Sync." The rsync command lets you transfer and synchronize data between different machines and directories. Using the Secure Shell (SSH) protocol, you can copy your files securely to another location. The rsync tool has many benefits when compared to other methods for copying files.
Using rsync With SSH and Your Key If you want details on what SSH is doing, add "-v" to the ssh options. To run rsync quietly, remove the "-v" option from both rsync and SSH option list. To reverse the synchronization so the remote file is updated on your local computer, reverse the source and destinations.
If you want to copy a file from one location to another within your system, you can do so by typing rsync followed by the source file name and the destination directory. Note: Instead of “/home/tin/file1. txt”, we can also type “file1” as we are currently working in the home directory.
As we already know, rsync uses the default SSH port 22 to sync files from remote to localhost and vice versa.
Try this one-liner:
rsync -av -e "ssh -A root@proxy ssh" ./src root@target:/dst
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With