Stopping unnecessary services
In this section, we will stop the services that we do not use frequently. In the Managing services section under Chapter 3, Your First Modules, we already stopped the SMB service for file and printer sharing. For users, we do not want them to share the folders and printers directly. All the sharing must be achieved through the file server or the document management system. Also, leaving these services open gives more opportunities to hackers to understand and footprint the target system. When we disable the SMB service, the hackers cannot exploit them.
We will create a module named stopservices
. It will have a very basic structure and will only have an init.pp
file. The structure is shown in the following screenshot:
First, let's copy and paste the code we used previously:
In the next step, we will also disable Remote Desktop Services for clients. We can do this only if we use a remote desktop management solution. Most corporations have this, so it becomes unnecessary...