How to enable disable firewall in Ubuntu

Ubuntu comes with a firewall configuration tool called UFW (Uncomplicated firewall). UFW is a convenient interface for managing firewall rules iptables, and its main goal is to simplify the management of firewall rules or, as the name implies, not complicate. It is highly recommended that you leave the firewall turned on. However, in some situations, such as testing, you may need to stop or disable firewall.



In this article, we will show you how to enable/ disable the UFW firewall. Before starting make sure you are logged in as a user with privileges sudo.

Checking the status of the firewall

To view the current status of the UFW firewall, use the ufw status command:
sudo ufw status
UFW firewall is disabled by default. If you have never activated UFW before, the output will show status as Inactive , Otherwise, if the firewall is turned on, you will see Active

Disabling Firewall

If you disable the firewall due to connectivity issues or have problems configuring the firewall, check out our guide on how to configure the firewall with UFW on Ubuntu. To disable the UFW firewall on your system Ubuntu use the ufw disable command:
sudo ufw disable
The output will look like this:
Firewall stopped and disabled on system startup
The above command will stop and disable the firewall, but will not remove the firewall rules. The next time you turn on the firewall, the same rules will be loaded.

Reset Firewall Rules

If you want to disable the firewall and remove all firewall rules, use the ufw reset command:
sudo ufw reset

Enabling the Firewall

Before turning on the firewall, make sure that the SSH port is open for connection.
To enable the firewall, run:
sudo ufw enable
Most UFW commands are intuitive and easy to remember. For example, ufw status shows the status of the firewall, and ufw disable disables the firewall.

How to generate strong passwords ?

The main problem of safe password is problem of remembering. I do not think there are a lot of people who can remember all these expressions like @ivrC8#4u_B8. So, maybe, each of us remember from school poems that facilitate learning difficult rules. We can apply such a principle to memorize a strong password, don't we?

secure password generator


Let's generate some passwords and choose from them one, for which we are able to imagine a good and not difficult phrase. For example, this:46v7or1hnWOW. I have gotten something very strange:46 villages, 7 oranges, 1 hamster, n and WOW (World of Warcraft). In fact, the phrase can be absolutely absurd, most important that you will be able to remember it.
We can choose another way, take random phrase or string from a poem and use it for making your safe password.
The first variant:password containing only the first letters of words. Storm has set the heavens scowling, whirling gusty blizzards wild. Let's take the main letters:shsthswgbw. But the password containing only letters is not safe, moreover, since only lower case is not reliable. Make it more difficult. For that let's add capital letters and punctuation. We will make like in Pushkin's poem for easy remembering:Shsths, Wgbw. Password has become better, but not enough. Now we will add special symbols and numbers. At the same time we will try to make sure that we are able to remember it. For example, we will use instead of verbs #, so, instead adjectives —*. Because this is the quote, we add «»in the begging and ending of it also. And, to complicate the task absolutely for hackers we will write 8 after the second letter. As result, we get:«S8##ths,W**w».
This password is a really safe and strong password because he has more 10 symbols, it contains letters both registers, numbers and special characters.
We can use another way of making phrase for strong password. We take the first part of the phrase known us and get not safe password:stormhassettheheavensscowling. Then we start to «conjure». We replace a couple of letters with special symbols. At the same time we pay attention that similar symbols (a like @, n/№, s/$) are traced by hacker programs for a long time, and it is unreasonable to do similar replacement. For safety let's add in our password some numbers (put them into places of "congestion"of vowels) and uppercase letters. We receive something similar:s8hst@Sw/5gb2w.
Remember following while generating strong password
  • Choose a password more complicated, consisting of characters of different register, with numbers and [for absolute reliability] punctuation marks.
  • Do not use a password associated with data that may be known about you, such as your name or date of birth.
  • The passwords that you see on the screen are created in real time on your computer , so the possibility of intercepting the password over the network is excluded. Different site visitors see different passwords. If you go to the site a second time, the passwords will be different .
  • You can select the browser's File | Save As ... menu item to use the offline password generator.
  • The password generator is completely transparent: download the passwd.js file to see how the password is created and ensure absolute reliability.