How to Block an IP Address From Attempting a Connection to Ubuntu

How to Block an IP Address From Attempting a Connection to Ubuntu thumbnail
The Ubuntu distribution is a good way for beginners to learn how to use Linux.

The Ubuntu Linux distribution is designed for ease of use, including security features such as the Uncomplicated Firewall that can be configured to block unwanted connections. It is best practice to set up a firewall to deny all incoming connections and add exceptions when required. However, there are instances in which allowing all but a few connections may be preferred. Configure and enable the Ubuntu UFW to block connections from only specific IP addresses while allowing other incoming connections when you wish to share data with some but not all hosts on the network.

Things You'll Need

  • Root or super user password for the Ubuntu computer
Show More

Instructions

    • 1

      Click "Applications" on the Ubuntu dashboard, then click "Accessories" or "See More Results," and click "Terminal." A terminal command prompt window will appear.

    • 2

      Type "sudo ufw default allow" at the command prompt, and press "Enter." Type the root password on the command line if prompted. Type "sudo ufw enable" at the command prompt, and press "Enter." Type the root password on the command line if prompted.

    • 3

      Type "sudo ufw deny from x.x.x.x" at the command prompt, except replace the "x.x.x.x" with the IP address you wish to block. Press "Enter."

Related Searches:

References

  • Photo Credit Jupiterimages/Photos.com/Getty Images

Comments

You May Also Like

Related Ads

Featured