How to Sync Directories Using Rsync with Custom SSH Port

SSH default port is 22, every body knew it. And it will cause many brute force SSH attacks.
For security reasons, Linux administrator should change to custom port to securing SSH access to Unix server from brute force attacks.
How to change default SSH Port
Before change port number, first open firewall port to new SSH Port, example change to port 12345, to prevent locked your self because SSH port closed by firewall.
On RHEL, CentOS, and Scientific Linux 7, allow the new port through your firewall.
# firewall-cmd --add-port 12345/tcp --permanent
On RHEL/CentOS/Scientific Linux 6 and before, you should allow new SSH port with command below.
# iptables -A RH-Firewall-1-INPUT -m state --state NEW -m tcp -p tcp --dport 12345 -j ACCEPT
# service iptables restart
If you have Selinux enabled, you should run this command
# semanage port -a -t ssh_port_t -p tcp 12345
Then Edit /etc/ssh/sshd_config and remark port 22 and add another port, for example 12345.
#Port 22
Port 12345
Then restart SSHD service using this command: