How To Setup a Firewall with UFW on an Ubuntu and Debian Cloud Server
How To Setup a Firewall with UFW on an Ubuntu and Debian Cloud Server
If you're running an Ubuntu or Debian cloud server, it's important to secure it by setting up a firewall. In this tutorial, we'll show you how to do just that using UFW.
Step 1: Install UFW
The first step is to install UFW if it's not already installed. You can do this by running the following command:
sudo apt-get install ufw
Step 2: Check UFW Status
Before you start configuring UFW, it's important to check its status. You can do this by running the following command:
sudo ufw status
Step 3: Configure UFW
Next, you'll need to configure UFW by allowing traffic for the services you want to use. For example, if you want to allow SSH traffic, you can run the following command:
sudo ufw allow ssh
You can also specify a port number if you want to allow traffic for a specific port:
sudo ufw allow 8080/tcp
If you want to deny traffic for a specific service or port, you can run the following command:
sudo ufw deny ftp
Step 4: Enable UFW
Once you've configured UFW, you'll need to enable it. You can do this by running the following command:
sudo ufw enable
After you enable UFW, it will start blocking traffic by default. You can check its status again by running the following command:
sudo ufw status
Step 5: Disable UFW
If you need to disable UFW for any reason, you can do so by running the following command:
sudo ufw disable
Conclusion
Setting up a firewall with UFW is an important step in securing your Ubuntu or Debian cloud server. By following the steps in this tutorial, you'll be able to configure UFW to allow or deny traffic for the services you want to use.
Keywords: Ubuntu, Debian, cloud server, firewall, UFW, setup, install, check, configure, allow, deny, enable, disable, SSH, port number, traffic, blocking.
Комментарии
Отправить комментарий