Hello friends welcome back in this section we're going to talk about different ways to protest or do
so.
OK we're going to learn different ways to protect our work.
So we're against hacker attacks or against an art that is Rexus.
OK.
So in this lesson I'm going to show you how to set up and you have w firewall by setting up your firewall
you can't protect your server.
OK.
From an advisory or IP addresses.
OK.
Or you can allow all the connections for only particular ports.
OK.
So let's see practically hope to set up a new firewall.
OK you know stands for uncomplicate firewall OK.
It is the most popular firewall in the school.
And that's why it comes by default in Linux distributions.
OK.
So you don't need to install in this Ubuntu server distribution by default it comes in this package
only in some cases if you want to install it just takes sudo is stolen.
You have to install the firewall.
You can only see how to use this firewall.
OK first of all you should check the status of the firewall.
So check the status this type Sudol w status.
OK.
Right now it says actually this will shows you the current status of the blue firewall.
OK.
If you want to disable the firewall in some situations then you can simply disable it by sudo.
You have to disable it it takes some time.
OK.
And not the status.
OK right now it is inactive.
And if you want to enable it then just type in invoke again take the status.
Right now it's easy to get in this way you can disable enable the firewall.
OK.
In some situation you need to reload all the rules of the firewall.
OK.
So in those situations you just need to simply type sudo with W reload key.
It didn't and now it says firewall reloaded.
OK in this way you can perform these basic operations with this new firewall.
The next operation that I would like to show you is how to allow calls or IP addresses from the firewall.
OK.
Let's talk about if you want to allow some particular ports on your server OK if you follow some connections
on a particular call.
OK.
Then in this condition you use to type sudo if you have to do a lot.
OK.
And I want to allow the connections on what we're going get to.
People generally used by.
OK.
All we learned in the last lessons about how to set up the assets is OK.
So I want connections outside connections on this board.
Then I can simply type like this and hit enter.
OK.
And after adding in this rule you can check the status.
OK.
After writing the rule you can see we got a different status.
OK.
In this way you can check the rules by status.
OK.
OK like the port number we can also add in particular IP address to connect on our server.
So for that just helps slow if you allow from.
OK if I want a connection from 1 9.
Got 1 6 8 0 0 0 1 true added.
Then check the status.
OK.
Now here you can see at line number two we have over rule.
OK.
That means this IP addresses are allowed on our server to connect OK like this we can't allow an particular
IP address a no particular order only.
OK.
So what you need to do for that Sudol w love from.
1 9 2 you got 1 6 8 0 1 and I want this IP address to connect only for granted.
OK.
So just like any port 22 this IP is allowed only on port number 22 after this rule did did the status.
This way we cannot allow any IP addresses in this V.
OK.
And after allowing.
We can also deny support or IP addresses.
So you deny in particular for just pipes.
You have to keep the key.
And if I want to deny Port Authority or give partner we're used to private service we're talking all
we have learned in the previous lesson.
He to OK.
He says really did exist sturgeons.
OK.
And you can also deny in particular IP.
So for that just the night from 1 9 4 1 6 0 1 0 0 0 Google kid.
His rule added means.
Suppose there is some hacker who was trying to hack a server and then you can grab that hackers IP address
and you can block that hacker from connecting to a surrogate by this one.
OK.
Alavi and denying the IP and port numbers I want to show you how good the lead the rules that we have
added.
So there are movies by which you can delete the rules in the firewall.
OK number one is with the help off number.
And number two is Vittal off.
Come on.
OK.
So let's see how you do this.
OK first just type sudo status number one.
OK get this view uses the numbers for each room.
OK.
So the numbers from 1 to 7 for each rule.
OK.
And I want to delete.
Rule number two here so read that.
So you have to delete and enter the number here in Atlanta to my Ok it is related.
Again take the status.
Now we have only six rules here with six numbers.
OK.
This is the first mail by which we can delete it rule.
OK.
The second way is from common means so you need to know how you entered the command.
OK.
So to delete I suppose who'll hear sudo if you get delete.
You need to type that.
Come on I mean suppose we have added allowing port number 22 for IP address 1 9 2 and 6.
So here sudo you have w delete allow from one line.
Once you've got 0 1
we're going to hit enter again later.
This is the second way for deleting the rule in the file.
Ok you need to have that come on like this.
OK.
In this way you can add the rules or delete the rules looking in the firewall.
OK.
All this depends on your requirement for a server.
What you want to do with your server.
Ok after doing all this there are some situations where you need to reset your firewall background you
know status.
OK.
So in such situations what you need to do is just pseudo cop you can type reset and you don't get into
why look at this reset the firewall back group's original status.
In this way you can use this firewall and secure your Ubuntu server from that has real users OK or an
authorized IP addresses.