Glossary termConcept

Daemon

Also known as: Background service

Computer program that runs in the background, without direct user interaction, to provide services or perform tasks on Unix-like systems.

In Unix-like operating systems, a daemon is a long-running background process that is not attached to an interactive terminal. Daemons are typically started when the system boots and wait for events, such as network connections, hardware changes or scheduled times, to which they respond. Examples include web servers, the SSH server sshd and the scheduler crond, which runs cron jobs. By convention many daemon names end with the letter d. On Microsoft Windows, comparable programs are called services.

The term was coined in the 1960s by programmers at MIT's Project MAC, inspired by Maxwell's demon, a thought experiment in physics about a tireless being sorting molecules in the background. The spelling daemon follows an older form of the word for an attendant spirit; later expansions such as Disk And Execution MONitor are backronyms. Traditionally, a program became a daemon by forking, detaching from its controlling terminal and starting a new session. On many Linux systems, systemd now starts, supervises and restarts daemons and collects their logs, removing much of that ceremony.

Daemons provide much of the infrastructure that users never see, from time synchronization and printing to logging and networking. Because many listen on network ports or run with elevated privileges, they form a significant part of a system's attack surface. Good practice is to run each daemon under its own unprivileged account, following the principle of least privilege, to disable daemons that are not needed and to keep them patched. The word has also been borrowed by other systems, for example in the Docker daemon that manages containers.

Key points

  • A daemon is a background process that runs without an interactive terminal, often from system startup.
  • Daemon names often end in d, as in sshd and crond.
  • The term was coined at MIT's Project MAC, inspired by Maxwell's demon.
  • Running daemons with minimal privileges reduces the damage a compromise can cause.

Related entries

Technology

systemd

DevOpsFOSS

System and service manager for Linux that runs as the first process at boot, starts and supervises services and bundles logging and other components.

Glossary term

Cron

DevOps

Time-based job scheduler in Unix-like operating systems that runs commands or scripts automatically at specified times, dates or intervals.

Glossary term

Operating System

HardwareProgrammingFOSS

System software that manages a computer's hardware resources and provides common services and interfaces for the programs that run on it.

Technology

Linux

FOSSHardware

Free and open-source Unix-like kernel created by Linus Torvalds in 1991 that underpins Android, most servers and many embedded devices.

Glossary term

Principle of Least Privilege

CybersecurityDevOps

Security principle that every user, program and process should have only the minimum access rights needed to perform its legitimate function.

Glossary term

Attack Surface

Cybersecurity

The total set of points where an unauthorized party could try to enter, extract data from or otherwise attack a system, network or organization.

Technology

OpenSSH

CybersecurityDevOpsFOSS

Free suite of secure networking tools based on the Secure Shell protocol, developed by the OpenBSD project and used for encrypted remote login.

Referenced by

Other entries that discuss or point to Daemon.