Modify the SSH port (CentOS/Debian) in one of Linux VPS Security Settings)

Source: Internet
Author: User
Tags ssh port

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.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.