[Autogenerated] And yes,
we need to continue our journey and look at how we
can use org to sort our output.
But source for both root log ins and invalid users.
Come on, let's find that command line working back on our command line.
We already know that we can print out those IP addresses
that are trying to access the root account.
But we want to be able to look for those invalid users where
the user name doesn't exist on our system.
So I'm going to begin by copying across the SSH root dot org file
and we can call this then SSH dash fi dot org.
Hm.
Is there ever a final, have we ever finished?
But let's call it final dot org.
Anyway, let's copy that across and edit the file.
Of course,
these files are going to be available through the course repository in any case,
but these are not difficult to go through an edit.
Now, now we can see then that I'm still using the black background,
the dark background.
I haven't set up a dot VM R C file.
So let me go through and configure set B G equals dark.
So we've got better syntax highlighting and I need to go through
and implement my search for the invalid users.
We only need to add in an additional block for our search.
So I'm going to copy these three lines.
So three Y Y and then using an upper case P I paste above the line
and then I can go through and edit the search.
Now, it doesn't matter which one that I search for.
First, let's just stay on this line as I'm already here.
And instead of looking for a failed password for root,
let's just clear this out.
We can go through and look at failed password for invalid user.
As long as we got our strings correct there for searching.
I have got a space at the end after user and root.
We should be ok.
Let's go through and change our field to field 13.
So field 13 for the invalid user, field 11 for root,
we don't need to change the end block.
Both main blocks are just populating the IP S array.
We can go through it and save our changes and that's it.
If we go back now and take a look at implementing our search,
let's not worry about counting.
Let's just look at SSH final dot org.
And this is a list of IP addresses.
All of these are unique IP addresses IP addresses that are
either trying to log in as root or a user account that
doesn't exist out of interest.
We might want to count now.
So word count minus L and there's 100 and 41 accounts or IP addresses that are
trying to access my system probably with malicious an intent.
Not obviously,
I don't want these people to gain access to the next videos we're
going to be taking a look at how we go through and block these with a
firewall and it becomes a very simple method.
But if we go through and look at the work that we've
done with our SSH final dot org,
we can see is this one file that is searching for both our
invalid users and our root account log ins and then creating
the sorted array of IP addresses.
So this is really good that we can do it with the one command.
But I say we want to be able to use the output of this command now to
ensure that these people can't do bad things on my system.
Do you want to look at how we do that?
I know ID.
Do.