rsync over ssh on non-default port

      1 Comment on rsync over ssh on non-default port

There are basically two ways of archiving this

Changing rsync’s rsh parameter

You can simply feed ssh with a different port parameter as remote shell to ssh:

$ rsync -a --inplace --rsh='ssh -p12345' file user@remotehost:dir/

Create a per host config for ssh

Add a Host entry to ~/.ssh/config

[...]
Host foobar
    Port 12345
    User user
    Hostname host.example

and invoke rsync with that alias

$ rsync -a --inplace file foobar:dir/

One thought on “rsync over ssh on non-default port

Leave a Reply

Your email address will not be published.