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 CentOS7 modifies the SSH login port

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

Share

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

Centos7 modifies that the default login port of ssh is similar to that of centos6, except that the firewall is different, and then it is best to turn off selinux.

[modify ssh default port 22]

Vi / etc/ssh/sshd_config

Add a line under Port 22, taking port 50000 as an example, Port 50000

Then save and restart the ssh service systemctl restart sshd.service

[release new ports in the firewall]

Firewall-cmd-permanent-add-port=50000/tcp

Use this command to query

Firewall-cmd-permanent-query-port=50000/tcp

If it is yes, it is successful. If it is no, it is not successful.

Reload firewall firewall-cmd-reload after success

[close selinux]

Check the selinux status sestatus. If it is enabled, it is enabled.

Vi / etc/selinux/config

Modify SELINUX=disabled

Then restart vps and try to log in with the new port 50000. If the login is successful, vi / etc/ssh/sshd_config delete Port port 22, and then restart the ssh service.

The above is the whole content of this article, I hope it will be helpful to your study, and I also hope that you will support it.

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