The old left has already shared in many previous articles the tutorials on installing lnmp and llsmp in centos or debian environments. It is certainly feasible to use personality guarantees of the old left, this is because I have written all the articles after actual operations. VPS beginners can learn how to install the system and build websites on Linux VPS. For the first time, the old man will not install the environment when using VPS. He wants to ask a netizen to install the environment and pay 50 yuan for it. In view of this, I will learn it myself.
After learning how to install and build VPS, we must learn the Security Settings of VPS. Because the VPS is different from the host, the host provider may back up the data, and the host security is guaranteed by the host provider. However, if we are currently using VPS, the security host provider of VPS is not responsible. Since we choose to use VPS, we must do a good job of security maintenance. In the next few articles, I will share some basic Linux VPS security settings. Today, we will share with you how to modify the SSH port.
No matter whether our website is famous or not, many hackers or their peers use software to directly scan the website's VPS/host port. Generally, we all know that the VPS port is 22, if we modify the port, at least the port cannot be found first, many times because our port is the default, even if the host security will leave a large number of log files. These files are the error records of brute-force cracking.
Modify the SSH port: log on to SSH, run the vi/etc/ssh/sshd_config command to open the file, and modify the number following the port. (Should the basic application of vi be? : Wq indicates saving and exiting, a indicates editing, and esc indicates exiting)
The last step is to restart ssh. It should be noted that centos and debian are different commands, which is also a question for many novice webmasters when playing with VPS. So let me talk about both methods.
Copy codeThe Code is as follows: CentOS restart SSH: service sshd restart
DeBian restart SSH: service ssh restart
Check whether it is correct. Use PUTTY to log on to SSH. The old left test is successfully modified.