Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to modify the ssh port of suse linux 10

2025-04-04 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

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.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report