The default ssh remote port in Linux is 22. Sometimes the default port will be scanned or attacked by people with ulterior motives. In order to make our system more secure, we need to change the remote port number. Steps: 1. Modify the ssh_config configuration file vim /etc/ssh/sshd_config 2. Find the line #Port 22 in the configuration file (the default port is 22) 3. Modify this line to the port number you want Port 222 (Note: remove the leading # sign) 4. [Optional] If you want to add a port number (port 22 and port 222 are effective at the same time) Port 22 (Note: no # sign in front) 5. After exiting, restart the sshd service /etc/init.d/sshd restart If you have a firewall set up, you need to add new port rules 6. Edit iptables file vim /etc/sysconfig/iptables 7. Add port 222 rules -A INPUT -m state –state NEW -m tcp -p tcp –dport 222 -j ACCEPT 8. Save and exit and restart the iptables service service iptables restart 9. Test the connection and call it a day. Summarize The above is the steps for changing the default remote port number of ssh in Linux 6. I hope it will be helpful to you. If you have any questions, please leave me a message and I will reply to you in time. I would also like to thank everyone for their support of the 123WORDPRESS.COM website! You may also be interested in:
|
<<: Detailed steps for installing and configuring MySQL 8.0 on CentOS 7.4 64-bit
Table of contents 1. Overview 2. nginx.conf 1) Co...
ylbtech_html_print HTML print code, support page t...
This article shares the installation tutorial of ...
I would like to share with you the graphic tutori...
Scenario The company project is deployed in Docke...
Today I was asked what the zoom attribute in CSS ...
Table of contents 1. Count data is lost Solution ...
Table of contents 1. Pull the Redis image 2. Crea...
This article shares the specific code for JavaScr...
MySQL handles duplicate data Some MySQL tables ma...
1. Clear floating method 1 Set the height of the ...
Copy code The code is as follows: Difference betw...
Table of contents 1. Use JavaScript to parse the ...
1. Stop the MySQL service in the command line: ne...
When we display long text, we often need to interc...