• DevOps
    Case Study

    How we built a resilient multi-account, multi-cloud solution for a Health Tech service provider!

    READ CASESTUDY
    icon

    24/7 DevOps as a Service

    Round-the-clock DevOps for uninterrupted efficiency.

    icon

    Infrastructure as a Code

    Crafting infrastructure with ingenious code.

    icon

    CI/CD Pipeline

    Automated CI/CD pipeline for seamless deployments.

    icon

    DevSecOps

    Integrated security in continuous DevOps practices.

    icon

    Hire DevOps Engineers

    Level up your team with DevOps visionaries.

    icon

    Consulting Services

    Navigate success with expert DevOps consulting.

  • TechOps
    Case Study

    How we built a scalable Odoo solution for a Travel Tech service provider!

    READ CASESTUDY

    WEB HOSTING SUPPORT

    icon

    HelpDesk Support

    Highly skilled 24/7 HelpDesk Support

    icon

    Product Support

    Boost your product support with our expertise.

    MANAGED SERVICES

    icon

    Server Management

    Don’t let server issues slow you down. Let us manage them for you.

    icon

    Server Monitoring

    Safeguard your server health with our comprehensive monitoring solutions.

    STAFF AUGMENTATION

    icon

    Hire an Admin

    Transform your business operations with our expert administrative support.

    icon

    Hire a Team

    Augment your workforce with highly skilled professionals from our diverse talent pool.

  • CloudOps
    Case Study

    How we helped a Private Deemed University in India, save US $3500/m on hosting charges!

    READ CASESTUDY
    icon

    AWS Well Architected Review

    Round-the-clock for uninterrupted efficiency

    icon

    Optimize

    Efficient CloudOps mastery for seamless cloud management

    icon

    Manage

    Automated CI/CD pipeline for seamless deployments

    icon

    Migrate

    Upgrade the journey, Migrate & Modernize seamlessly

    icon

    Modernize

    Simplify compliance complexities with our dedicated services

    icon

    FinOps as a Service

    FinOps as a Service

  • SecOps
    Case Study

    How we built a scalable Odoo solution for TravelTech service provider!

    READ CASESTUDY
    icon

    VAPT

    Vulnerability Assessment and Penetration Testing

    icon

    Source Code Review

    Ensuring source code security ans safe practices to reduce risks

    icon

    Security Consultation

    On demand services for improving server security

    icon

    System Hardening

    Reduced vulnerability and proactive protection

    icon

    Managed SoC

    Monitors and maintains system security. Quick response on incidents.

    icon

    Compliance as a Service

    Regulatory compliance, reduced risk

  • Insights
    Case Study

    How we helped a Private Deemed University in India, save US $3,500/m on hosting charges!

    READ CASESTUDY
    icon

    Blog

    Explore our latest articles and insights

    icon

    Case Studies

    Read about our client success stories

    icon

    Flipbook

    Explore our latest Flipbook

    icon

    Events

    Join us at upcoming events and conferences

    icon

    Webinars

    Watch our educational webinar series

  • Our Story
  • Contact Us

Interested to collaborate?

Get in touch with us!

Ready to elevate your business with certified cloud expertise? Contact us today to learn how our team can help you leverage cloud technology to drive growth, streamline operations, and enhance security.

  • AWSAWS
  • Azure CloudAzure Cloud
  • Google CloudGoogle Cloud
  • Akamai CloudAkamai Cloud
  • OVHOVH
  • Digital OceanDigital Ocean
  • HetznerHetzner
  • Kubernetes Consultancy Services
  • K8s & Cloud native Solutions
  • 24/7 Infrastructure Monitoring
  • DevOps as a Service
  • Cloud CI/CD Solutions
  • White Labeled MSP Support
  • Our story
  • Life@SupportSages
  • Insights
  • Careers
  • Events
  • Contact Us

Connect with us!


LinkedInFacebookXInstagramYouTube

aws partneraws advanced partner
SupportSages

Copyright © 2008 – 2026 SupportSages Pvt Ltd. All Rights Reserved.
Privacy PolicyLegal TermsData ProtectionCookie Policy
Should you run SSH on alternate ports ?

Should you run SSH on alternate ports ?

Nidhin George

  • 5 min read
Should you run SSH on alternate ports ?

Generating audio, please wait...

Do we need security through obscurity? My answer would be ‘yes‘, we need security through obscurity as well. Well changing the ssh port from the default 22 to a non-default one is desired and is recommended by me. But do not simply rely on this method though for SSH security.

On a publicly accessible server with default port as 22, you will see thousands of failed login attempts of which 99.9% would be brute force attempts to login as root or using common usernames known. At the same time, if you change the default port to a random one like 22289, then there will be less login failures. This is because, there are many bots out there which exploit scans against IP addresses who have been found to be running a specific service, in this case SSH. It could be scans or actual login attempts. There are firewalls like csf/lfd, bfw, fail2ban etc available which can help block the IP addresses which tries to brute force the service though. Also you can have rate-limiting rules written to block the IPs which exceeds a given rate of connections to port 22.

Also certain bugs like heartbleed, allows for attacking and gaining access to your server just by connecting to an open ssh port. By using non-standard ssh port, we can avoid this. But again, patching the sshd is the best solution than keeping on running your server on non-default ssh port. You may also think of port-knocking where in, anyone who want to ssh to the server should knock a port other than the SSH port, to get themselves login to the server. Depending on how you write a port-knocking rule, you can tell the system to REJECT or DROP a direct ssh connection attempt to SSH port.

How to change it?

  • Don’t exit from the current session, unless you login to the SSH using the new ssh port.

  • Consider you are running the SSH port on 22289 and unfortunately ssh service got crashed. Since the default ssh port is changed to something else which is above the privileged port number of 1024, a normal user can run a fake sshd service on port 22289 and gather the password of all the users trying to login.

  • How would you stop this? Well ssh host keys and known_hosts file would alert you, but normal users wont bother. Even though, a sysadmin should detect whether a normal user is running the daemons, I am wondering whether it is possible to add non-privileged port to the list of privileged ports of <1024. Well I don’t know.

How should you run SSH then ?

Here is a list of things you can do to make sure that the SSH is relatively secure.

  • Change your SSH port to non-default one

  • Allow only password less authentication

    Promotional banner

  • If possible modify your PAM to have the 2FA setup.

  • Enable port-knocking for SSH

  • Enable rate-limiting for the service

  • Don’t allow direct root logins even through password-less authentication

  • Disable empty passwords and configure idle timeout interval

  • If possible allow only certain users and IPs to access the SSH service

  • Make sure that port-scanning is taken care of using any of the third party tools.

  • Don’t disable SELinux, unless you are testing or doing a PoC or you don’t have time to fix the broken applications and binaries



Get 24/7 expert server management

  • Security
  • server
Promotional banner
Promotional banner

ASSP – A Good Open Source and Cheap Alternative to Commercial Spam Fighting Solutions

ASSP – A Good Open Source and Cheap Alternative to Commercial Spam Fighting Solutions
  • Email service
  • Security
logo

How to troubleshoot an issue – The sysadmin way

How to troubleshoot an issue – The sysadmin way
  • server
logo

PHP-FPM Vulnerability (CVE-2019-11043) can lead to Remote Code Execution on nginx

SupportSages Logo
  • Linux
  • nginx
  • PHP
  • Vulnerabilities
logo

WordPress Websites Showing 500 Internal Server Error – Causes and Solutions

WordPress Websites Showing 500 Internal Server Error – Causes and Solutions
  • server
  • WordPress
logo

Posts by Nidhin George

Nidhin has started his career as a Linux System Administrator since 2013 and holds vast experience in server administration, CMS management and cPanel systems. Apart from this he's a movie buff and have a huge collection of movies.