Specifying a different ssh port while doing rsync

Use rsync with the -e option to specify the port:

rsync -avr -e 'ssh -p 9992' files/ [email protected]:/var/www/

Here, you specify the port with rsync -e 'ssh -p PORT'


You are reading this post on Joel G Mathew’s tech blog. Joel's personal blog is the Eyrie, hosted here.