Featured resource
2025 Tech Upskilling Playbook
Tech Upskilling Playbook

Build future-ready tech teams and hit key business milestones with seven proven plays from industry leaders.

Check it out
  • Lab
    • Libraries: If you want this lab, consider one of these libraries.
    • Cloud
    • Security
Google Cloud Platform icon
Labs

Change SSH Port from 22 to 61613

After you start any instance with public access, automated scripts will find you almost immediately and start conducting all sorts of scans and probing. There is no real way to completely stop this. You can confirm this is happening by looking at the log files of any public instance you create. However, we don't need to make it easy for them. A standard scan will usually check for known standardized ports associated with known services. For example, SSH by default runs on port 22 and is the first port any script will check for an SSH service. Now, if we configure SSH service to run on port 61613, the scan script will need to make a broad port sweep to find our SSH service. This is extremely taxing in terms of bandwidth for the attacker, and generally scripts will not check for these ports. That is why it is very important for us to change the port at which SSH operates from 22 to something that is not standardized, making it much more difficult for any one script to find our SSH service.

Google Cloud Platform icon
Lab platform
Lab Info
Level
Intermediate
Last updated
Sep 23, 2025
Duration
30m

Contact sales

By filling out this form and clicking submit, you acknowledge our privacy policy.
Table of Contents
  1. Challenge

    Open `/etc/ssh/sshd_config`, Uncomment the `Port` Variable, and Change the Value from 22 to 61613

    Note: Please provide the lab an extra 1-2 minutes before logging in to make sure the lab is fully provisioned. A local SSH terminal must be used for this lab (This lab cannot use the Instant Terminal). You will find the necessary login credentials on the lab page.

    1. Open configuration file:
    sudo vim /etc/ssh/sshd_config
    
    1. Change the value of Port:
    Port 61613
    
    1. Save and close:
    ESC
    :wq
    ENTER
    
  2. Challenge

    Open Port 61613 with firewalld
    1. Open the port with firewalld:

      sudo firewall-cmd --permanent --add-port=61613/tcp
      
    2. Reload to apply the rules:

      sudo firewall-cmd --reload
      
  3. Challenge

    Configure SELinux to Allow Connections on Port 61613 for SSH
    sudo semanage port -a -t ssh_port_t -p tcp 61613 
    
  4. Challenge

    Restart SSH, Log Out and Back in on Port 61613, and Close Port 22 with firewalld
    1. Restart SSH:

      sudo systemctl restart sshd
      
    2. Log out:

      exit
      
    3. Log in on port 61613:

      ssh cloud_user@<Server_IP_Address> -p 61613
      
    4. Close port 22 with firewalld:

      sudo firewall-cmd --permanent --remove-port=22/tcp
      
      sudo firewall-cmd --reload
      
About the author

Pluralsight Skills gives leaders confidence they have the skills needed to execute technology strategy. Technology teams can benchmark expertise across roles, speed up release cycles and build reliable, secure products. By leveraging our expert content, skill assessments and one-of-a-kind analytics, keep up with the pace of change, put the right people on the right projects and boost productivity. It's the most effective path to developing tech skills at scale.

Real skill practice before real-world application

Hands-on Labs are real environments created by industry experts to help you learn. These environments help you gain knowledge and experience, practice without compromising your system, test without risk, destroy without fear, and let you learn from your mistakes. Hands-on Labs: practice your skills before delivering in the real world.

Learn by doing

Engage hands-on with the tools and technologies you’re learning. You pick the skill, we provide the credentials and environment.

Follow your guide

All labs have detailed instructions and objectives, guiding you through the learning process and ensuring you understand every step.

Turn time into mastery

On average, you retain 75% more of your learning if you take time to practice. Hands-on labs set you up for success to make those skills stick.

Get started with Pluralsight