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
In the MySQL database, after tables are associate...
Preface Project requirements: Install the Docker ...
There are two types of MySQL installation files, ...
1. Meaning of partition table A partition table d...
Table of contents Hbase installation and configur...
How to reset the initial value of the auto-increm...
Using Javascript to implement countdown to close ...
Table of contents Preface: Encryption algorithm: ...
1. First, download the corresponding database fro...
<br />First think of the idea, then draw a s...
Install related dependencies npm i lib-flexible -...
Today, my colleague encountered a very strange pr...
Original link https://github.com/XboxYan/no… A bu...
1. Check whether the existing nginx supports ipv6...
Copy code The code is as follows: <span style=...