Simple VPS security settings

Source: Internet
Author: User
We are already in the borderless network age. Are you confused? What is a borderless network? What is the difference between a borderless network and a previous network ?...... 1. enable the firewall and disable/etc/init for unnecessary ports. d/iptablesstart // simple rules are as follows:

We are already in the borderless network age. Are you confused? What is a borderless network? What is the difference between a borderless network and a previous network ?......

1. enable the firewall and disable unnecessary ports

/Etc/init. d/IptablesStart // simple rules are as follows.

/Sbin/iptables-F
/Sbin/iptables-a input-p tcp-I vnet0 Cdport ssh-j ACCEPT
/Sbin/iptables-a input-p tcp-I vnet0 Cdport 80-j ACCEPT
/Sbin/iptables-a input-I vnet0-m state CstateESTABLISHED, RELATED-j ACCEPT
/Sbin/iptables-a input-p ICMP-j DROP
/Sbin/iptables-a input-I vnet0-j DROP

Several iptables are simple. after modification, restart iptables.

/Etc/init. d/iptables restart

2. change the ssh Port. Note that the firewall should enable this port. Otherwise, it is forbidden. in principle, change it to port 5000 or above.

Vi/etc/ssh/sshd_config // change the number following the search Port to the Port number you want. delete it if there is a # number before the Port.

3. prohibit root login. Be sure to create a common user first. Otherwise, it will be tragic.

Vi/etc/ssh/sshd_config // search for PermitRootLogin and change "yes" to "no". if there is a # sign in front, delete it.

Second, restart ssh after completing step 3.

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.