Block ip trên linux
Ví dụ IP cần block là: 1.2.3.4 1. Ban IP trong SSH: sử dụng server hay VPS đã cài CSF, do đó để BAN 1 IP có thể sử dụng lệnh 2. Ban 1 dãy IP trong SSH: tương tự như trên, có thể dùng lệnh csf -d IP/[range] [range] ở đây là dãy IP range. Đối với bạn thì chỉ cần lưu ý các dãy 24,16,8 là được. Lệnh này sẽ block toàn bộ các IP từ 1.2.3.0 đến 1.2.3.255 (có đầu 1.2.3.*) Lệnh này sẽ block toàn bộ các IP từ 1.2.0.0 đến 1.2.255.255 (có đầu 1.2.*.*) Lệnh này sẽ block toàn bộ các IP từ 1.0.0.0 đến 1.255.255.255 (có đầu 1.*.*.*) 3. Kill 1 process trong SSH: kill -9 [PID] Chúc bạn thành công. 1. Ban IP trong SSH: sử dụng cPanel đã cài CSF, do đó để BAN 1 IP có thể sử dụng lệnh csf -d IP 2. Ban 1 dải IP trong SSH: tương tự như trên, có thể dùng lệnh csf -d IP/[range] [range] ở đây là dãy IP range. Đối với bạn thì chỉ cần lưu ý các dãy 24,16,8 là được. - Lấy ví dụ thực tế việc block các dải IP nhé: csf -d 210.245.80.0/24 Lệnh này sẽ block toàn bộ các IP từ 210.245.80.0 đến 210.245.80.255 csf -d 210.245.0.0/16 Lệnh này sẽ block toàn bộ các IP từ 210.245.0.0 đến 210.245.255.255 csf -d 210.0.0.0/8 Lệnh này sẽ block toàn bộ các IP có đầu 210.*.*.* 3. Kill 1 process trong SSH: Khi em sử dụng lệnh "top" thì cột đầu tiên của lệnh top là "ID" , đây là Process ID , bạn cần kill process nào thì sử dụng lệnh: kill -9 [PID] Chúc bạn thành công. Last updated on: 2021-05-05 Authored by: Morgan Marion A large number of requests from one IP address can deplete the server of available resources. This article provides the commands to block an IP address on three common Linux® software firewalls. Prerequisites
NOTE: These steps are for servers that are not RackConnect® cloud servers. For RackConnect, make changes in the dedicated firewall. Log on to the server by using SSH and then complete the steps in the following sections. firewalld toolfirewalld is available on the following Linux versions:
Uncomplicated Firewall (UFW)The UFW tool is available on the Ubuntu® operating system 8.04 LTS and later.
iptables tool
Use the Feedback tab to make any comments or ask questions. You can also start a conversation with us. ©2020 Rackspace US, Inc. Except where otherwise noted, content on this site is licensed under a Creative Commons Attribution-NonCommercial-NoDerivs 3.0 Unported License See license specifics and DISCLAIMER |