• WordPress
  • cPanel
  • Softaculous
  • KVM Virtualization
  • Vmware Virtualization
  • Proxmox
Sunday, June 15, 2025
LinuxBoost
  • Home
  • Almalinux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Red Hat Enterprise Linux
  • Rocky Linux
  • OpenSUSE
  • Arch Linux
  • Oracle Linux
No Result
View All Result
LinuxBoost
  • Home
  • Almalinux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Red Hat Enterprise Linux
  • Rocky Linux
  • OpenSUSE
  • Arch Linux
  • Oracle Linux
LinuxBoost
  • Home
  • Almalinux
  • CentOS
  • Debian
  • Fedora
  • Ubuntu
  • Red Hat Enterprise Linux
  • Rocky Linux
  • OpenSUSE
  • Arch Linux
  • Oracle Linux

How to Change SSH Port on openSUSE

in Linux OS, OpenSUSE
How to Change SSH Port on openSUSE

Changing the default SSH port on your openSUSE system can help improve security by making it more difficult for unauthorized users to connect to your server. In this tutorial, we will guide you through the process of how to change SSH port in openSUSE system.

Table of Contents:

How to Change SSH Port on openSUSE

  1. Why change the SSH port?
  2. Prerequisites
  3. Update your system
  4. Edit the SSH configuration file
  5. Restart the SSH service
  6. Adjust the firewall settings
  7. Test the new SSH port

Why change the SSH port?

The default SSH port (22) is a common target for brute-force attacks and port scanning. Changing the port number can help reduce the number of unauthorized connection attempts, making your system more secure.

Prerequisites

Before proceeding, make sure you have the following:

  1. An openSUSE system with SSH server installed
  2. Root access to the system

Update your system

Before making any changes, ensure that your system is up to date by running the following command:

zypper update

Edit the SSH configuration file

To change the SSH port, you need to edit the SSH configuration file. You can use any text editor, such as Vim or Nano. If you don’t have Vim installed, follow our guide on How to Install Vim on openSUSE. In this example, we’ll use Vim:

vim /etc/ssh/sshd_config
Edit the SSH configuration file

Look for the following line:

#Port 22

Uncomment the line by removing the ‘#’ symbol and change the port number to your desired value. For example, to set the port to 2222:

Port 2222

Save the file and exit the editor.

Restart the SSH service

To apply the changes, restart the SSH service:

systemctl restart sshd

Adjust the firewall settings

Next, update your firewall settings to allow traffic on the new SSH port. In this example, we will allow traffic on port 2222:

firewall-cmd --permanent --zone=public --add-port=2222/tcp
firewall-cmd --reload

Don’t forget to remove the old SSH port from the firewall:

firewall-cmd --permanent --zone=public --remove-port=22/tcp
firewall-cmd --reload

Test the new SSH port

Finally, test the new SSH port by connecting to your server using the new port number:

ssh user@your_server_ip -p 2222

If the connection is successful, you have successfully changed the SSH port on your openSUSE system.

Conclusion

Changing the default SSH port on openSUSE is a simple yet effective way to enhance your server’s security. By following this tutorial, you have learned how to change the SSH port, update the firewall settings, and test the new port.

Now that you have secured your SSH connection, consider exploring other security measures for your openSUSE server, such as:

  • Installing a firewall, like CSF
  • Securing your database with MariaDB or MySQL
  • Setting up SSL certificates for your web server

Remember that server security is an ongoing process. Keep your system updated, monitor logs, and stay informed about the latest security best practices. By being proactive, you can ensure the safety and integrity of your openSUSE server.

ShareTweet
Previous Post

How to Install Git on openSUSE

Next Post

How to Install Vim on openSUSE

Related Posts

How to Install Tomcat on Rocky Linux

How to Install Apache Tomcat on Rocky Linux

How to Set up NTP Server on Rocky Linux

How to Set up NTP Server on Rocky Linux

How to Install Bacula Backup Server on Rocky Linux

How to Install Bacula Backup Server on Rocky Linux

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Golden Host VPS
  • Privacy Policy
  • Terms and Conditions
  • About Us
  • Contact Us

Copyright © 2023 linuxboost.com All Rights Reserved.

  • Privacy Policy
  • Terms and Conditions
  • About Us
  • Contact Us

Copyright © 2023 linuxboost.com All Rights Reserved.