Get the App
SLTechnology News&Howtos  ›  Servers  › 

How to modify the ssh port of suse linux 10

Shulou Source: shulou.com Published: 2022-06-01 06:24:39 11月22日 Update

This article shows you how to modify the ssh port of suse linux 10, which is concise and easy to understand, which will definitely brighten your eyes. I hope you can get something through the detailed introduction of this article.

In suse linux 10, for security reasons, if we want to modify the default port 22 of SSH, then you just need to modify: / etc/ssh/sshd_config Port 22, here change 22 to the port you want to set, but do not set it to the same port as the existing port, in case of unknown consequences.

If you want to limit the IP of SSH login, you can do the following: first modify / etc/hosts.deny, add sshd:ALL to it and then: modify: / etc/hosts.allow, and set it as follows: sshd:192.168.0.241 so that only 192.168.0.241 IP can be logged on to the SUSE LINUX machine through SSH. Of course, as a server, I do not install gnome and KDE, and a lot of things are not installed, so as to increase the safety factor.

When remote debugging and modification, you can first keep the original port 22, directly add the port you want to modify, and then delete the original port after success. First, modify the configuration file vi / etc/ssh/sshd_config to find the section # Port 22. Here, the logo uses port 22 by default, which is modified as follows: Port 22 Port 5890, and then save and exit. Execute / etc/init.d/sshd restart or restart the SSH service by service sshd restart. This way the SSH port will work with 22 and 5890 at the same time. Now edit the firewall configuration: vi / etc/sysconfig/iptables enables port 5890. Execute / etc/init.d/iptables restart now use the ssh tool to connect to port 5890 to test for success. If the connection is successful, edit the settings of sshd_config again and delete the Port22 inside. The reason why it is set to two ports first, and then one port is closed after a successful test, is to prevent in the process of modifying sshd_conf, in case of unknown circumstances such as disconnection, network disconnection, misoperation and so on, it can be connected to another port to debug so as to avoid the failure of connection and the need to send someone to the computer room, resulting in more complicated problems.

After modifying the port, you can ssh-p 5890 root@192.168.0.241 to connect.

The above is how to modify the ssh port of suse linux 10. Have you learned any knowledge or skills? If you want to learn more skills or enrich your knowledge reserve, you are welcome to follow the industry information channel.

Tags: Port success security content skills knowledge services testing login configuration limitations complexity same concise safety factor concise two reasons again only Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft Docker Apple vpn Linux