How to stop and unseal IP addresses in centos 7

Source: Internet
Author: User
Tags vps

How to stop and unseal IP addresses in centos 7

I. Stopping an ip address

I haven't logged on to my VPS for a long time. I logged in with Xshell today and saw the Last Failed Login. I carefully checked that some unknown ip addresses tried to crack my VPS, after confirming with the partner that it is not his ip address, he decided to block the ip address.


(Figure 1: An unknown ip address attempted to log on to my VPS)

Command for stopping ip addresses in centos 7: iptables

Usage (case sensitive ):

Iptables-IINPUT-s ***. ***-jDROP


(Figure 2: iptables blocking ip addresses)

Parameter-I indicates Insert (ADD), followed by rules, INPUT indicates inbound ,***. ***. ***. * ** indicates the IP address to be blocked, and DROP indicates that the connection is abandoned. After the command is successfully executed, no prompt is displayed. To view the list of blocked ip addresses, run the following command:

Iptables -- list

(Figure 3: Use the list parameter to view the IP addresses blocked by the DROP command. The IP addresses under the source command are blocked)

Ii. unblocking ip addresses

1. Replace-I with-D for unblocking, provided that iptables already has this record:

Iptables-DINPUT-s ***. ***-jDROP

2. If you want to clear the blocked IP address, enter:

Iptables -- flush

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.