Rsync to non standard SSH port

Hi Guys,

While I was configuring my new VPS box I realized that it may not be a good thing to keep port 22 as default for SSH connections. Thus I decided that it will be port 2224 for SSH communication.

I love putty as all others, I am not a typical system admin but I love playing around with few things. CPanel is one of those things.

One of the software that I use too often is rsync

You can become expert user of rsync by just following this manual

http://linux.die.net/man/1/rsync

anyway this is not about explaining what rsync is, you are reading this post because you already know what rsync is.

Now coming back to my original point, so I configure my VPS disabled my port 22 and enabled my port 2224 for SSH communications, If you don’t know how I did this here is a tip for you

and put your desired port in as shown below

You will need to allow your firewall to allow port 2224 for incoming

All done then restart your sshd service as

Now I wanted to rsync from my local server to my production VPS at port 2224 this is how I did it

As you can see is that trick is to instruct rsync to connect to the non standard port that is done by this bit “ssh -p NEW_PORT_NUMBER

Above can be rewritten for port 2224 as

You can add other flags if you wish, many a times we try to preserve permissions and owners at the target so that is one thing I always do else everything gets messed up.

I hope this helps

Cheers

Advertisement

 

 

 

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.