Today I've learned: Services on Linux

What’s a service?

Service is an application that runs in the background and it is waiting for you to use it.

Controlling services

Basic syntax for controlling services is:

service servicename start|stop|restart

For example to see services we can do:

service --status-all

And we can see some services listed:

 [ - ]  apache-htcacheclean
 [ + ]  apache2
 [ - ]  apparmor
 [ - ]  atftpd
 [ + ]  binfmt-support
 [ - ]  bluetooth
<...>

As you can see there are minuses and pluses in front of the services.

Turning on the service

As you can see Bluetooth isn’t running. Let’s start this service.

service bluetooth start

Let’s check the status of the service:

service bluetooth status
bluetooth.service - Bluetooth service
     Loaded: loaded (/usr/lib/systemd/system/bluetooth.se>
     Active: active (running) since Tue 2025-01-07 13:31:>
 Invocation: 691aae0cc73
       Docs: man:bluetoothd(8)
   Main PID: 34977 (bluetoothd)
     Status: "Running"
      Tasks: 1 (limit: 9201)
     Memory: 2.5M (peak: 3.3M)
        CPU: 145ms
     CGroup: /system.slice/bluetooth.service
             └─34977 /usr/libexec/bluetooth/bluetoothd

Article about how to connect BT devices using CLI is in the future…

Databases

Database is also a service. It’s waiting for you to be used.

Two of the most popular and widely used databases are MySQL and PostgreSQL. MySQL stands behind database-driven web applications while PostgreSQL is the default database of the most popular penetration testing and hacking framework - Metasploit.

These databases are installed by default on Kali.

Other services

There are many other services that are very important for a hacker. Some of those services are:

Apache2

It’s HTTP web server which is most commonly used service on Linux systems. This Web Server is often associated with the MySQL database and in most cases these two services are paired with a scripting language such as Python or PHP to develop web applications. This collective is called LAMP (Linux, Apache2, MySQL, PHP or Python).

SSH

It’s an acronym for Secure Shell. It enables us to securely connect to a remote terminal on the another system. The most widely used Linux SSH is OpenSSH.

We can use SSH to manage remote systems.

For hackers it can be useful for connection to the compromised system.

Final thoughts

  • The world of services is very broad. I’m interested in many of these services and I’m very curious.

  • I had an opportunity to play with bluetooth service. It’s a very interesting experience to connect your device via CLI. More about it in the next article.

  • SSH is a very powerful tool. You can just leave your computer running and connect to it remotely. For example you can have kind of a hacking station where you can connect and do a research about things that needs to be researched.

  • Databases are another world which holds many of the information that could be accessed by people that shouldn’t see it. Security of databases is really important.

Credits

I’m learning using this book:

Linux Basics For Hackers by OCCUPYTHEWEB (MASTER OTP)

You can purchase it here

0
Subscribe to my newsletter

Read articles from Jonas Satkauskas directly inside your inbox. Subscribe to the newsletter, and don't miss out.

Written by

Jonas Satkauskas
Jonas Satkauskas