Loginctl linger is the systemd login control command or setting used to manage lingering for a user account. It enables or disables background user services that continue after logout and may start at boot, separate from any live session.
What Loginctl Linger Does
systemd lingering changes the lifecycle of a user account from session-bound to account-persistent. When linger is enabled, selected user services can continue after logout and may be started at boot, which makes the setting a control point for long-running personal daemons, scheduled tasks, and background automation.
This matters because the setting changes when work runs and what survives a disconnect. For operators, it is less about the login shell itself and more about whether the user manager remains available to keep services alive independently of an interactive session.
Why It Matters for Background Services
Lingering is useful when a user-owned service must remain available even when no one is logged in, such as a sync process, a developer toolchain, or a lightweight worker. It can reduce dependence on ad hoc session keepalives and make service startup more predictable across reboots.
The same behavior can also blur the boundary between temporary and persistent execution. A process that should have died with the session may keep running, so the operational question is not just whether the service works, but whether its lifetime is intentionally governed.
Because lingering extends the service horizon beyond a live session, it is often discussed alongside account and service governance. The broader control problem is to know which user contexts are permitted to persist and whether that persistence is still justified over time.
How Lingering Changes Control and Visibility
From a security perspective, lingering creates a more durable execution surface under a user context. That can be appropriate, but it also means the machine may continue to host processes, sockets, timers, and environment assumptions long after the interactive user has gone away.
This has implications for visibility and troubleshooting. If a service starts at boot or survives logout, administrators need to know whether it is expected, who owns it, and how it is configured, because a persistent user service can otherwise look like an orphaned process chain rather than an approved workload.
It also affects review discipline. The existence of lingering is not itself a vulnerability, but it raises the importance of service inventory, ownership clarity, and configuration review so that persistent user services do not become forgotten infrastructure.
Common Operational Trade-offs
Lingering trades convenience for persistence. That is often desirable in environments where user-scoped automation is simpler than system-wide service management, but it also means the account becomes a more durable runtime boundary.
In practice, that can help with developer workflows, personal daemons, and per-user agents, while also making deprovisioning and change control more important. If the user account is no longer supposed to run anything, lingering may keep background activity alive unless it is explicitly disabled.
For that reason, lingering should be treated as an intentional lifecycle choice rather than a default convenience setting. The useful question is not only “does the service start?” but “should this user still own a process that survives logout and boot?”
Risk and Threat Considerations
Persistent user services can outlive the interactive context that launched them, which creates exposure if the account is misused, over-permissioned, or forgotten. A lingering service may continue to consume resources, expose a local socket, or preserve a foothold that administrators assume ended with logout.
Failure mechanism: An attacker or insider who gains execution under a user account can exploit lingering to keep code running after the session ends, increasing persistence and making cleanup harder if the service is not inventoried or disabled.
Impact: The result can be unauthorized long-lived execution, missed detection of abnormal background activity, and a weaker offboarding posture when user-owned services survive beyond the intended lifetime of the account.
Standards & Framework Alignment
This section maps relevant standards and security frameworks to the operational risks and controls described in this guidance.
NIST SP 800-53 Rev 5 and CIS Controls v8 set the technical controls, while ISO/IEC 27001:2022 defines the regulatory obligations.
| Framework | Control / Reference | Relevance |
|---|---|---|
| NIST SP 800-53 Rev 5 | AC-2 — Account Management | Lingering affects whether user-owned services continue under an account lifecycle. |
| CM-6 — Configuration Settings | Lingering is a host configuration that changes service persistence across logout and boot. | |
| AU-6 — Audit Review, Analysis, and Reporting | Persistent user services need review to spot unexpected long-lived activity. | |
| Recommendation — Review and disable lingering when the account no longer needs persistent execution. Baseline and review lingering settings as part of approved configuration management. Correlate lingering-enabled services with logs to detect unexpected persistent execution. | ||
| CIS Controls v8 | CIS-5 — Account Management | Persistent user services are governed through account ownership and lifecycle control. |
| CIS-8 — Audit Log Management | Lingering can mask long-lived activity unless logging shows what kept running. | |
| Recommendation — Remove lingering when user accounts are no longer authorized to run background services. Log and review persistent user-service activity to spot unexpected continuation after logout. | ||
| ISO/IEC 27001:2022 | A.5.18 — Access rights | Lingering extends what an account can continue doing after a session ends. |
| Recommendation — Revalidate lingering against current access rights and remove it when no longer required. | ||
Practitioner Guidance
What to watch for: Treat lingering as an explicit ownership decision, not a convenience toggle. If a user service must survive logout or boot, document why it exists, who owns it, and when it should be turned off.
Governance implication: Review lingering settings during account lifecycle changes, especially offboarding and role change events, so persistent services do not remain active after the business need has ended. The setting is safest when it is tied to a named operational purpose rather than left enabled by habit.
Related resources from NHI Mgmt Group
- Who is accountable when identity platform vulnerabilities linger after disclosure?
- Why do security findings often linger even when teams have mature scanning in place?
- What happens when a malicious dependency is allowed to linger in an environment?
- Why do cloud permission misconfigurations linger after they are found?
Deepen Your Knowledge
Free weekly newsletter
Subscribe to the NHI & AI Identity Journal
The latest on NHI and Agentic AI security – articles, research, breaches, news and events every week.
Bonus 33% off our NHI Course when you subscribe.
Reviewed and updated by the NHIMG editorial team on November 25, 2026.
NHI Mgmt Group — the #1 independent authority on Non-Human Identity, IAM, and Agentic AI security. nhimg.org