Increasing Security by Changing the SSH Port Number
After establishing an SSH connection to your server, changing the default port number 22 can provide simple yet effective protection against many common attacks. As White Bilişim Teknolojileri, we explain how changing the SSH port number can enhance your security.
Steps to Change the SSH Port Number
- 1. Establish an SSH Connection: Connect to your server via SSH from the terminal.
- 2. Install the Nano Editor: To change the port number, run the following command in the terminal to install the
nano
editor.
yum install nano
- 3. Edit the SSH Configuration File: Open the SSH configuration file using the following command:
nano /etc/ssh/sshd_config
- Find the line that says
#Port 22
. Remove the #
symbol at the beginning of the line and replace 22
with the new port number you want to use.
Note: Make sure that the new port number is not being used by another application and is open in the firewall. Otherwise, you may encounter connection issues.
- 4. Restart the SSH Service: To apply the changes, restart the SSH service using the following command:
service sshd restart
Conclusion
- By following these steps, you have added extra security by changing the default port number for SSH connections. At White Bilişim Teknolojileri, we are always here to help you manage your servers securely.