Ubuntu UFW BLOCK
时间: 2024-01-01 21:43:40 浏览: 49
Ubuntu 设置Samba服务器
4星 · 用户满意度95%
To block an IP address using UFW (Uncomplicated Firewall) on Ubuntu, follow these steps:
1. Open the terminal on your Ubuntu machine.
2. Check if UFW is installed by running the command:
```
sudo ufw status
```
If it is not installed, install it using the command:
```
sudo apt-get install ufw
```
3. Once UFW is installed, enable it using the command:
```
sudo ufw enable
```
4. To block an IP address, use the command:
```
sudo ufw deny from <IP address>
```
Replace <IP address> with the actual IP address you want to block.
5. Verify that the IP address has been blocked using the command:
```
sudo ufw status
```
The blocked IP address should be listed under "Status: inactive" or "Status: active".
Note: If you want to unblock the IP address later, use the command:
```
sudo ufw delete deny from <IP address>
```
Replace <IP address> with the actual IP address you want to unblock.
阅读全文