LinuxCommandLibrary

pam_ck_connector

Connect ConsoleKit sessions to PAM authentication

SYNOPSIS

As a PAM module, pam_ck_connector is not executed directly as a command-line utility by users. Instead, it is invoked by the PAM system during user login and logout processes. Its "invocation" is defined within PAM configuration files, typically located in /etc/pam.d/.

The common syntax for its inclusion in a PAM configuration file (e.g., /etc/pam.d/login or /etc/pam.d/system-auth) is:

session  optional  pam_ck_connector.so

Or, if used with specific control flags (rarely needed for this module):

session  [success=1 default=ignore]  pam_ck_connector.so

Here, "session" indicates it's part of the session management stack, and "optional" suggests that its failure should not prevent a session from being established, though this might lead to incomplete session tracking. The ".so" suffix denotes it as a shared library module.

PARAMETERS

(No direct command-line parameters)
    As an internal PAM module, pam_ck_connector typically does not accept direct command-line parameters. Its behavior is largely fixed: to report session events to ConsoleKit or systemd-logind.

debug
    Like other PAM modules, it can be accompanied by standard PAM control flags in /etc/pam.d/ configuration files. This flag enables logging of verbose debugging information, which can be useful for troubleshooting.

quiet
    A standard PAM control flag that suppresses non-essential messages from the module.

non_interactive
    A standard PAM control flag used in contexts where no user interaction is possible. It's important to note that pam_ck_connector itself rarely, if ever, uses these flags to modify its core functionality; they are primarily PAM framework directives.

DESCRIPTION

pam_ck_connector is a Pluggable Authentication Module (PAM) designed to integrate the PAM authentication stack with the session management capabilities provided by systems like ConsoleKit or systemd-logind. Its primary role is to inform these session managers about the creation and termination of user sessions. When a user logs in (e.g., via login, sshd, or a display manager), PAM processes the authentication, and if pam_ck_connector is configured in the session stack, it notifies the session manager that a new session has started. Similarly, upon logout, it signals the session manager to end the session. This interaction is crucial for tracking active user sessions, associating them with specific seats (physical or virtual terminals), and managing resources like display servers, power management, and device access. It ensures that system services are aware of who is logged in and what resources they are using, facilitating proper resource allocation and security policies. It operates in the background as part of the PAM workflow, making it an invisible but vital component of a desktop or server environment's user session management.

CAVEATS

  • Dependency: pam_ck_connector relies on the presence and proper functioning of a session manager like ConsoleKit or systemd-logind. If these services are not running or configured correctly, the module might fail to report session information, leading to issues with desktop environments, power management, and device access for logged-in users.
  • Superseded Technology: In modern Linux distributions that use systemd, ConsoleKit has largely been superseded by systemd-logind. While pam_ck_connector might still be present for compatibility or specific niche setups, pam_systemd is the module typically used to integrate with systemd-logind directly. Users should verify which session manager their system employs.
  • Internal Use: This module is intended for internal system use within the PAM framework and should not be manually invoked or modified by end-users unless they have a deep understanding of PAM and session management. Incorrect configuration can lead to authentication failures or incomplete session tracking.

SESSION CGROUP MANAGEMENT

Beyond just reporting session starts and ends, pam_ck_connector (and its successor pam_systemd) plays a role in creating and managing control groups (CGroups) for user sessions. When a user logs in, the session manager (ConsoleKit or systemd-logind) typically creates a dedicated CGroup for that session. All processes launched within that session are then placed into this CGroup. This allows the system to accurately track resources used by the session, apply resource limits, and ensure that all session-related processes are properly terminated upon logout. This mechanism is fundamental for robust multi-user environments and modern desktop functionality.

INTEGRATION WITH DISPLAY MANAGERS

Display managers like GDM, LightDM, or SDDM are often configured to use PAM for authentication and session management. When you log into your graphical desktop, the display manager uses PAM, and if pam_ck_connector (or pam_systemd) is in the session stack, it ensures that the session manager is informed about the graphical session's creation. This enables functionalities such as proper suspension/hibernation, user switching, and device hot-plugging to work seamlessly within the desktop environment.

HISTORY

The pam_ck_connector module emerged as part of the ConsoleKit project, which aimed to centralize session management on Linux systems, particularly for desktop environments. Before ConsoleKit, managing user sessions, device access, and power management across various login methods was fragmented. ConsoleKit provided a unified D-Bus API for these tasks, and pam_ck_connector was its PAM-side interface, ensuring that PAM could communicate session start/end events to ConsoleKit.

With the rise of systemd, many distributions transitioned from ConsoleKit to systemd-logind, which provides similar session management capabilities integrated directly into the init system. While pam_ck_connector might still be found in some systems for legacy reasons or specific configurations, its role has largely been taken over by pam_systemd, which serves the same function but for systemd-logind. Its development and usage are closely tied to the evolution of desktop environments and system initialization on Linux.

SEE ALSO

pam(8), login(1), sshd(8), consolekit(8), systemd-logind(8), pam_systemd(8)

Copied to clipboard