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:
- 30 Handy Bash Shell Aliases For Linux / Unix / Mac OS X
- Top 30 Nmap Command Examples For Sys/Network Admins
- 25 PHP Security Best Practices For Sys Admins
- 20 Linux System Monitoring Tools Every SysAdmin Should Know
- 20 Linux Server Hardening Security Tips
- Linux: 20 Iptables Examples For New SysAdmins
- Top 20 OpenSSH Server Best Security Practices
- Top 20 Nginx WebServer Best Security Practices
- 20 Examples: Make Sure Unix / Linux Configuration Files Are Free From Syntax Errors
- 15 Greatest Open Source Terminal Applications Of 2012

- My 10 UNIX Command Line Mistakes
- Top 10 Open Source Web-Based Project Management Software
- Top 5 Email Client For Linux, Mac OS X, and Windows Users
- The Novice Guide To Buying A Linux Laptop












{ 4 comments… read them below or add one }
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
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.
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
thanks man!!!!