Rsync Change SSH Port Number While Making Backups

by on July 20, 2010 · 5 comments· LAST UPDATED January 15, 2014

in , ,

How do I change my rsync command port number while making backup to remote server at port 10253 (my ssh server runs on tcp port # 10253)? How do I change port number while using rsync command?

Tutorial details
DifficultyEasy (rss)
Root privilegesNo
Estimated completion time1m
Yes, it possible to change or use a different ssh port when using rsync command on Linux or Unix-like operating systems. If your ssh server is running on TCP port # 5000, try the following command to change port number. It is pretty simple command:

sync -av -e 'ssh -p PORT-NUMBER-HERE' /path/to/source

Use a different ssh port when using rsync

In this example, I am going to backup /home/vivek/ directory to the server called at TCP port number 5000, enter:

rsync -av -e 'ssh -p 5000' /home/vivek
See also:
Tweet itFacebook itG+ itDownload PDF versionFound an error/typo on this page?

{ 5 comments… read them below or add one }

1 Vamsi August 10, 2010 at 1:50 pm

I faced this problem some time ago..but I sorted it out myself after reading the man pages
wish this post was made sometime ago :D


2 DonC November 2, 2010 at 8:03 pm

We dont use a remote shell, but I need to specify what port the client starts the request on – as well as what port the remote host is listening on. Is that possible?

For security reasons, we want to allow rsync, but the “random port” from the client is causing me issues.


3 DonC November 2, 2010 at 8:03 pm

clarification – we dont use a remote shell with rsync. here is the basic command we use in our scripts:

rsync –verbose user1@


4 hemant April 10, 2013 at 11:48 am

thanks man!!!!


5 Justin Dorfman July 27, 2013 at 8:14 pm

Thanks Vivek! Please get on so we can pay you!


Leave a Comment

Tagged as: , , ,

Previous Faq:

Next Faq: