Managing Kali Linux services

The Kali Linux operating system can function as a server for various types of services, such as Secure Shell (SSH), Hypertext Transfer Protocol (HTTP), and many more. In this section, I will demonstrate how to enable and disable various services. Once a service is running on a system, an associated network port is opened. For example, if HTTP is enabled on a machine, the default logical port is 80; for SSH, the port is 22.

Further information on services and port number assignments can be found on the Internet Assigned Numbers Authority (IANA) website at https://www.iana.org/assignments/service-names-port-numbers/service-names-port-numbers.xhtml.

To enable a service in Kali Linux, we can use the service <service-name> command syntax. In our example, we are going to enable the Apache web server, and, using the netstat –antp | grep <service-name> command we can verify that the associated service is running and that the network port is open, as shown in the following screenshot:

The last column contains the service name; in our exercise, we can see apache2 listed. This indicates that the web services are running—specifically, that the Apache2 web service is active on Kali Linux.

To enable SSH, we can use the service ssh start command.

Additionally, since it's a web server, we can open our web browser and enter the loopback IP address, 127.0.0.1, to verify that the default Apache web page is loading on our screen:

However, if our Kali Linux machine is powered off or restarted, the services that we previously enabled will revert back to their default start up settings. What if we want to ensure that certain services always start during the boot process of Kali Linux? This can be done by using the update-rc.d <service-name> enable command in the Terminal window:

In our example, we have enabled the SSH service, which will allow us to remotely access our Kali Linux machine over a network securely. The HTTP server will allow us to access the web server pages.

Last but not least, we can disable individual services and disable services from automatically starting during the boot process, as shown in the following screenshot:

In the voice of Uncle from the Jackie Chan Adventures, "One more thing!", I recommend changing the default password for the root account on Kali Linux. To change the password, open the Terminal window and execute the passwd command. The interactive prompt will ask you to enter your new password and verify it.

Please note that when entering passwords on a Terminal interface on a Linux-based operating system, the characters you enter do not appear on the screen/Terminal.

In this section, you have learned the skills essential for using the Kali Linux operating system. These skills include navigating the filesystem, updating and installing software packages, and enabling and disabling services.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.15.197.123