How to block an IP address with ufw on Ubuntu Linux server

Originally published at: https://www.cyberciti.biz/faq/how-to-block-an-ip-address-with-ufw-on-ubuntu-linux-server/

I am using UFW to manage firewall on my Ubuntu Linux 12.04/14.04 LTS server. I need to block a specific IP address from accessing my server. How do I block an IP address using ufw?


Linux sysadmin blog - Linux/Unix Howtos and Tutorials - Linux bash shell scripting wiki