In addition to controlling the applications
being installed on a workstation,
administrators should ensure that only necessary services
that are needed to run are allowed to run.
Services are a type of application
that runs in the background of the operating system
and it performs various functions like the print spooler.
Any services that are unneeded should be disabled
within the operating system.
In this lesson, I'm going to show you how to disable services
in Windows and in macOS X.
So first, we're going to go into the Windows environment.
We're going to hit on the Windows key in the corner,
the Start menu, and we're going to type in services.msc
and hit Enter.
That's going to open up the services' local connection.
You can see the name of the services down the left column,
a description of what they do,
the status if they're running or not,
what the startup type is,
whether it's manual, automatic, or disabled,
and how it's logged in.
What I'm going to look for here is the Windows Update Service,
which is what provides our Windows patches.
If I scroll the way down here, you'll see Windows Update,
and if I double click on it,
you'll see it is currently running.
It is an automatic type of startup
and this is used to detect, download,
and install updates for Windows and other programs.
If you're in a large enterprise environment, though,
we don't want to download our updates
directly from Windows and install on the endpoints.
Instead, we want to push it out
through a patch management system.
So we're going to go ahead and turn off this service.
To do that, we're going to hit Stop.
Now, when we stop,
it's going to shut down that service and it did,
but it's still set to automatically start up.
So if I reboot this computer, that is going to start up again.
To prevent that, we can go to Automatic
and turn it to disabled.
Go ahead and hit Apply
and now we have a service that is stopped and is disabled
and no longer is currently running.
This means that Windows update
will not work anymore in the background
because I've killed that service.
This is a useful thing
because if you have a piece of malware
that installs itself as a service,
you can go in, find it, stop it,
and disable it to be able to remove it better.
We can do the same thing inside the command prompt.
To do that, just click on your Windows Key
and type command prompt or CMD.
From here, you can use sc,
which is to control it through the services,
stop and the name.
For that program that we just stopped, it is the wuauserv,
which is the name of the Windows update program,
as you can see right here.
So if I go back, if I hit Enter, it would stop that service.
It won't do that right now because it's already stopped,
but that is the command that you would use,
sc stop wuauserv.
The other way you can stop this in Windows
is using the net command and it's net stop
and the name of the service that you want to stop,
again, net stop wuauserv
or whatever the piece of malware
or other services that you want to turn off.
Next, I'm going to show you how you can do it
in a Macintosh system.
To do that, you can go ahead
and first we're going to create something to kill.
So I'm just going to create a text pad
and I'm going to call it Kill This Process When Ready.
And that just gives me
something that I'm going to be able to kill.
Now, to find it, I'm going to go ahead
and use the Activity Monitor,
which is under your applications, then go to Utilities,
and then Activity Monitor.
From here, I'm going to sort by process name
and find text edit.
You can see all of these different services
that are running in the background.
Even though I only have
three or four programs actually running,
all of these background services are still running too.
I can go ahead and find that.
And if I wanted to get rid of it,
I'll just double click on it.
You can see how much memory it's using,
any statistics about it,
what open files and ports are currently in use.
In this case, it's some hidden files
that it's saving for this,
as well as some configurations and logging.
And if I want to get rid of this,
all I have to do is hit Quit.
It's going to ask me if I want to quit it cleanly,
like you normally would quit an application
or force quit it, which terminates it immediately,
doesn't save anything.
This was a piece of malware.
That's exactly what I would want to do,
and I can go ahead and hit Force Quit
and you'll notice it went away.
Next, I'm going to show you how you can do this
on a Linux system.
A Linux system and a macOS X system
actually share a lot of the same commands.
And in fact, this Linux command of kill and top
is going to be used both in a macOS X, which is Unix-based,
and a Linux.
So I'm going to go ahead and open up that text edit again
just so I have a process to kill.
I'm then going to open up my command line,
which in a Mac or a Linux terminal is called the terminal.
I'm going to bring this over to the left side,
and if I want to see what processes are currently running,
I can use the command top.
Top will show me what processes are currently running.
Processes are also known as services.
Now we have 537 different processes running.
And we can go through here
and find which one we want to kill.
In this case, it's the text edit
and the process ID is 2513.
So what I'm going to do is I'm going to quit out of that,
and to kill it, you just type in kill
and the process ID 2513,
and watch on the right side as text edit goes away.
There you go. It's that simple.
Anytime you have a piece of malware
or a service you want to kill on a Unix or a Linux system,
just type in kill, PID for process ID,
and the number that's associated with it.