Rsync Change SSH Port Number While Making Backups

by on July 20, 2010 · 4 comments· last updated at July 20, 2010

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

The command to change port number is pretty simple:

sync -av -e 'ssh -p PORT-NUMBER-HERE' /path/to/source user@backup1.example.com

Backup /home/vivek to server1.nixcraft.net.in at port number 5000, enter:

 
rsync -av -e 'ssh -p 5000' /home/vivek backupop@server1.nixcraft.net.in
 

See also:

man rsync



You should follow me on twitter here or grab rss feed to keep track of new changes.

Featured Articles:

{ 4 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 ..lol.
wish this post was made sometime ago :D

Reply

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.

Reply

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@5.2.2.5::user1

Reply

4 hemant April 10, 2013 at 11:48 am

thanks man!!!!

Reply

Leave a Comment

You can use these HTML tags and attributes for your code and commands: <strong> <em> <ol> <li> <u> <ul> <kbd> <blockquote> <pre> <a href="" title="">

Tagged as: , , , , , ,

Previous Faq:

Next Faq: