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
1 |
shell> vi /etc/ssh/sshd_config |
1 |
Uncomment the line |
1 |
# Port 22 |
and put your desired port in as shown below
1 |
Port 2224 |
You will need to allow your firewall to allow port 2224 for incoming
All done then restart your sshd service as
1 |
shell> service sshd restart |
Now I wanted to rsync from my local server to my production VPS at port 2224 this is how I did it
1 |
rsync -avz -e 'ssh -p NEW_PORT' /source user@abc.com:/remote/path |
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
1 |
rsync -avz -e 'ssh -p 2224' /source user@abc.com:/remote/path |
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