Rsync over SSH with a custom port

Published: 2018-12-21 13:51:22 +0000
Categories: BASH,




It's not at all uncommon nowadays for SSH not to be listening on TCP 22, but to instead be bound to another port - primarily to prevent brute force attacks by the various dumbest-of-the-dumb bots out there

Occasionally, though, you then want to use rsync over an SSH tunnel, and need to specify the port to use so that rsync uses the custom SSH port instead of port 22

It's pretty straightforward, but is one of those things I use infrequently enough to need to look it up from time to time


rsync -avz -e "ssh -p [port number]" /local/path [user]@[remotehost]:/path/to/dest/dir/

Usage Example

rsync -uavz -e "ssh -p 8822" /mnt/imagestore


rsync, ssh, custom port,

Latest Posts

Setting Git author details for a single repo (Git)
Checking Virtual Machine Resource Allocations with Libvirt (BASH)
Rsync over SSH with a custom port (BASH)
Remotely backing up PFsense Configuration (BASH)
FFMPEG: Converting RMVB to X264 MP4 (BASH)
Recursively print table (print_r equivalent) (LUA)
Bulk Delete Comments from (Self-Hosted) JIRA Issues (Misc)
Add a static entry to the ARP table (BASH)
SSL Cipher Hex codes to Human Readable Names (Misc)
Convert Ascii to Binary (BASH)

Copyright © 2019 Ben Tasker | Sitemap | Privacy Policy
Available at and snippets.6zdgh5a5e6zpchdz.onion