To block an IP address with ufw on an Ubuntu Linux server, follow these steps:
- Open a terminal window
- Check the status of ufw with the following command:
sudo ufw status - If ufw is not enabled, enable it with the following command:
sudo ufw enable - Block the IP address with the following command:
sudo ufw deny from <ip_address> - Verify the IP address has been blocked with the following command:
sudo ufw status
Note: Replace <ip_address> with the actual IP address that you want to block.