- In this video we'll talk about UFW.
So UFW is Uncomplicated Firewall,
and it was developed to work with an intuitive syntax.
You use it on Ubuntu. Let's check it out.
So here we are on the Ubuntu server,
and I'm using sudo ufw status,
where we can see it's inactive.
Well, I want it to be active.
So enable,
and now it is active.
So if we do a status again,
we can see it is active.
So next we are going to specify what we want it to do.
sudo ufw allow ssh.
Oops, that was a typo.
And now the rule is added for IPv4 as well as IPv6.
And we have allow, we can also use reject.
And I'm using reject out ssh.
So that means that we do allow incoming SSH,
we don't allow outgoing SSH.
Next I'm using sudo ufw status,
and we can see exactly what is going on.
So let me use
sudo ufw delete reject out ssh.
That is what you do
if you regret that you've done something.
Now, we can also do more complicated stuff,
like sudo ufw deny proto tcp from 10.0.0.10 to any port 22.
So that means that anything coming from 10.0.0.10,
a specific host,
is not allowed on any network card port 22.
We can verify that using sudo ufw status,
and there we can see the DENY line that is nicely listed.
So sudo ufw reset
will reset everything.
That is your "I'm desperate" option,
and that's easy if you wanna get out.
Now UFW also works with apps.
You can use services.
When we use sudo ufw allow ssh,
it uses a service,
and that corresponds to the service names in /etc/services.
Now I'm going to use sudo ufw app list.
Oops, ufw.
And there we can see that it has
the amazing amount of one application, OpenSSH.
Well, as we only have one application,
I'm bound to using that.
sudo ufw app info OpenSSH.
The applications that you've got
depend on the packages that you have installed.
And on the slide you can see Samba.
I don't have Samba installed,
so I also don't have the application.
Now if I use sudo ufw logging on,
that's what we can use to enable logging.
And finally if you want to know more,
man ufw.
It has a man page,
and in that man page you will find the rule syntax,
containing some examples,
and it's a pretty big man page, and hopefully it's helpful.
That's all I wanted to tell you about UFW.