Rsync on servers with custom SSH port

Tags: rsyncrsync over sshssh

Published on: September 22, 2014 by Karthikeyan B.

Rsync on servers with custom SSH port


My requirement was to rsync /etc/yum.repos.d/ with another server running the SSH on port 1791. Normal rsync won’t work and we need to specify the rsync custom ssh port in the rsync command itself. The command I had to execute is below

Rsync over custom SSH port

rsync -av -e 'ssh -p 1791' /etc/yum.repos.d/ xx.xx.xx.xx:/etc/yum.repos.d


Rsync using SSH key:

rsync -avz -e "ssh -i /path/to/private/key" username@hostname or IP path/to/remote/files/ /local/files/


rsync using SSH key & Custom port

rsync -avz -e "ssh -i /path/to/private/key -p 1791" username@hostname or IP path/to/remote/files/ /local/files/

Get 24/7 expert server management 

Category : Howtos, Linux

Karthikeyan B.

Karthikeyan B.

Karthi always loves to tread through less traveled paths. His desire to decipher complex technologies and pursuit for excellence makes this otherwise jovial guy to a tough brain to crack when it comes to technology. He got great intrest in environmental issues and advocates for sustainable, inclusive, development patterns and projects.

You may also read:


Add new commentSIGN IN

Let's Connect


Your Cart

Cart is empty.

Send this to a friend