You are currently viewing How to Change SSH Port of Linux VPS Server

It’s normal to receive bots attack if you kept your ssh port default 22. We recommend you to change the ssh port to something else. Automatic scrips and bots randomly attack all public IP addresses on all the known ports and try logging into those servers on various brute force methods. So, changing the SSH port will make it hard for those scripts to guess your SSH port and prevent the most common attacks.

To Change SSH Port of Linux VPS Server

Step-1: Connect to your server via SSH as a root user.

Step-2: Run the following command: vi /etc/ssh/sshd_config (or you can use any other text editor you want in place of vi)

Step-3: Locate the following line: # Port 22

Step 4: Remove the # symbol and change 22 to your desired port number.

Step-5: Restart the sshd service by running the following command: service sshd restart

How do I order a new Cloud VPS server?

Also, we recommend you to use the CSF firewall (if possible) for better security. Although changing only the SSH port does not guarantee your security, it can absolutely increase the strength of security when combined with other security measures.

এই কনটেন্ট বাংলায় পড়ুন: আমি কিভাবে আমার লিনাক্স ভিপিএস সার্ভারের জন্য SSH পোর্ট পরিবর্তন করব ?