Rsync with non-standard ssh ports
Posted on In QAThis problem appears when I try to rsync
directories with hosts inside a cluster used NAT for forwarding ports to internal nodes. Hence, the ssh port for internal nodes are not the default 22
. So, how to use rsync with the non-standard ssh ports?
The -e
options of rsync
play the trick very well. For example, to use ssh to example.com with port 13022:
$ rsync -avxP --delete -e "ssh -p 13022"
you_username@example.com:/remote/path/ /local/path/