How to change SSH Port

blog background image

Linux server normally or default use 22 port for SSH access. SSH is one of the most popular communication protocols on the Internet. It's widely used by developers, webmasters, and sysadmins. It allows you to gain remote access to your new Cloud or Dedicated box in just seconds using an encrypted communication channel. 

 

Today I will show how to change ssh port of linux server or cPanel server. SSH comes listening on port 22, which is widely known among attackers and security tools/port scanners that launch brute force attacks against it. While this is considered security by obscurity, it helps to eliminate lots of noise on port 22.

 

Login your SSH using your server password 

 

Run this command : nano -w /etc/ssh/sshd_config 

Search: Port 

You will see that 22 port is there just replace it 

For example 1255 

Then save it and exit.

Then run this command: service sshd restart  

or 

systemctl restart sshd

This is one of the oldest and most popular ways to obscure the SSH service.

 

Related Blog Post

Create, collaborate, and turn your ideas into incredible products with the definitive platform for digital design.

SEO Roadmap: Server Infrastructure & Strategy Guide

12 December 2025

SEO Roadmap: Server Infrastructure & Strategy Guide

Boost your 2026 rankings with our ultimate SEO guide. Learn how to optimize for AI agents using NVMe SSDs, LiteSpeed Cac

Read More
The Unnoticed Significance of Your Web Hosting Provider affect

05 May 2025

The Unnoticed Significance of Your Web Hosting Provider affect

For website success you need a good hosting company who give you proper service. Toshost ensure your every needs fulfil.

Read More

Got a question!

Contact us at