Home > Uncategorized > rsync over ssh on non-default port

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/
(No Ratings Yet)
Categories: Uncategorized Tags:
  1. No comments yet.
  1. No trackbacks yet.