Changing the default SSH port from the default 22 is one of the things you should do to secure your server.
The main benefit of changing the default port is to avoid being scanned by casual port scans.
Changing the default port to a random number get rid of some dangerous brute-force attacks.
-
Login Via SSH
First you need to log in to your VPS via SSH. If the default port is 22 then you will not need to specify the port.
ssh root@IP_Address
-
Update Packages
For CentOS
yum update -y
For Ubuntu
apt-get update $$ apt-get upgrade
-
Open SSH Config File
Once the packages are updated, open the SSH configuration file with your favourite editor and find the line that specifies the SSH port
vim /etc/ssh/sshd_config
#Port 22
-
Change port number
Uncomment the line by removing the # sign and change the default port 22 to one that you want to use.
Port 9845
Save changes and exit
NB:
Before changing the port, you should make sure that the new port is free and not used by any other service on your VPS.
You should also check that the port is not closed by your server’s firewall
-
Restart SSH Service
For the changes to take effect, the service needs to be restarted
service sshd restart
-
Check SSH port
Once restarted, SSH will listen on port 9845 .
This can be checked by running the following command
netstat -tunlp |grep ssh
Domain SearchSecure your perfect UAE domain in seconds.
Domain TransferSeamless domain transfer. Zero downtime, complete control.
All TLDsSecure your ideal domain. Explore local UAE and international extensions.
WHOIS LOOKUPCheck domain ownership, expiry dates, and registrar details instantly.
AE DomainsRegister a .AE domain and build trust in the UAE.
.com DomainGet the world’s most trusted domain and build credibility from day one.
Web hostingFind budget-friendly hosting that doesn’t compromise on performance.
Windows HostingHigh-performance hosting for Windows applications and websites.
Affiliate ProgramBecome a partner and earn commission for every referral.
WordPress HostingBlazing-Fast WordPress Hosting, Optimised for Performance.
Email HostingSecure your communications with professional email hosting. Use your domain, stay in control.
Reseller HostingLaunch your own hosting brand. We handle the tech, you grow your business.
cPanel HostingHosting supported by cPanel (simple and user-friendly)
VPS HostingVirtual servers that grow with you. Full root access. Blazing fast performance.
Managed VPS HostingNot a tech expert? Let us handle everything with our fully managed VPS hosting.
Dedicated ServersEnjoy full access and total control over your dedicated physical server.


