# Using custom port for rsync over ssh

**URL:** <https://linux-tips.com/t/using-custom-port-for-rsync-over-ssh/467>\
**Category:** Network\
**Created:** [January 21, 2017, 7:58pm UTC](https://linux-tips.com/t/using-custom-port-for-rsync-over-ssh/467 "2017-01-21T19:58:09Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sputnik](https://linux-tips.com/user_avatar/linux-tips.com/sputnik/32/91_2.png) [@sputnik](https://linux-tips.com/u/sputnik)\
**Post date:** [January 21, 2017, 7:58pm UTC](https://linux-tips.com/t/using-custom-port-for-rsync-over-ssh/467/1 "2017-01-21T19:58:09Z")

</div>

I’m using following command to archive local directory to a remote server with rsync through ssh tunnel:

```auto
$ rsync -a /local/dir user@host:/backup/dir

```

I want to use same functionality with another server but this time, ssh runs on a non-standard port (14022) on the remote side. How can I use rsync over ssh with custom port?

---

<div class="post-metadata">

**Author:** ![RaskoX](https://linux-tips.com/user_avatar/linux-tips.com/raskox/32/92_2.png) [@RaskoX](https://linux-tips.com/u/RaskoX)\
**Post date:** [January 21, 2017, 8:08pm UTC](https://linux-tips.com/t/using-custom-port-for-rsync-over-ssh/467/2 "2017-01-21T20:08:47Z")

</div>

You can use any ssh parameter if you start to tunnel with **-e** option like that:

```auto
$ rsync -a -e "ssh -p 14022" /local/dir user@host:/backup/dir

```

For example, if you want to force using **IPv6** addresses, just add standard **-6** ssh parameter to above command:

```auto
$ rsync -a -e "ssh -p 14022 -6" /local/dir user@host:/backup/dir

```

You can combine any other ssh parameters in that way.

See: [man ssh](http://manpages.org/ssh)
