Skip to main content

Deploy authentik Agent on Linux

authentik: 2025.12.0+

What it can do​

Prerequisites​

You must configure your authentik deployment to support the authentik Agent.

Create an enrollment token​

If you already have an enrollment token, skip to Install the authentik Agent on Linux.

  1. Log in to authentik as an administrator and open the authentik Admin interface.
  2. Navigate to Endpoint Devices > Connectors.
  3. Click on the authentik Agent connector that you created when configuring your authentik deployment to support the authentik agent.
  4. Under Enrollment Tokens, click New Enrollment Token, and configure the following settings:
    • Token name: Provide a descriptive name for the token.
    • Device group (optional): Select a device access group to add the device to after enrollment.
    • Expiring (optional): Set whether the enrollment token expires.
  5. Click Create.
  6. (Optional) Click the Copy icon in the Actions column. You need this value to join the device to an authentik domain.

Install the authentik Agent on Linux​

The authentik Agent consists of the following packages:

PackageInstall onContents
authentik-cliEvery deviceThe ak command.
authentik-sysdEvery deviceThe system agent, ak-sysd, which enrolls the device and reports device facts.
authentik-agent-desktopWorkstations with a graphical desktopThe authentik Agent app, which runs the user agent. Requires WebKitGTK, GTK 3, and AppIndicator.
authentik-agentServers and devices without a desktopThe user agent, as the systemd user service ak-agent.

Install either authentik-agent-desktop or authentik-agent. The two packages can't be installed together.

SSH server authentication and local device login also need libnss-authentik, which makes authentik users and groups available on the device, and libpam-authentik, which lets them log in. After you install them, configure NSS and PAM.

  1. Add the authentik package signing key:

    curl -fsSL https://pkg.goauthentik.io/keys/gpg-key.asc | sudo gpg --dearmor -o /usr/share/keyrings/authentik-keyring.gpg
  2. Add the authentik package repository:

    echo "deb [signed-by=/usr/share/keyrings/authentik-keyring.gpg] https://pkg.goauthentik.io stable main" | sudo tee /etc/apt/sources.list.d/authentik.list
  3. Install the packages. On a server, replace authentik-agent-desktop with authentik-agent.

    sudo apt update
    sudo apt install authentik-cli authentik-sysd authentik-agent-desktop
  4. (Optional) To enable SSH server authentication and local device login, install the NSS and PAM packages:

    sudo apt install libnss-authentik libpam-authentik

apt upgrade updates the authentik Agent.

Start the user agent on a server​

With the authentik-agent package, start the user agent for your user. ak connects to the user agent, so it must run for every user who uses ak:

systemctl --user enable --now ak-agent

Verify the installation​

Run ak version. The output starts with authentik Agent CLI: <version_number>, followed by the versions of the user agent and the system agent.

Join the device to an authentik domain​

Joining the device to an authentik domain is what enrolls it with your authentik deployment and issues it a device token. This step is required for device compliance features, for the device accepting SSH connections, and for local device login.

  1. Open a Terminal session and run the following command:
sudo ak-sysd domains join <deployment_name> --authentik-url https://authentik.company
  • deployment_name identifies the authentik deployment on the device.
  • https://authentik.company is the fully qualified domain name of the authentik deployment.
  1. Enter your enrollment token when prompted.
  2. After you enter the token, authentik enrolls the device. The device appears on the Devices page after it checks in.

Configure NSS and PAM​

SSH server authentication and local device login need the libnss-authentik and libpam-authentik packages, and NSS and PAM must be configured to use them.

The packages configure NSS and PAM when they're installed. No further steps are needed.

pam_authentik only handles authentik users. Local users continue to log in with their local password.

To check the configuration, run sudo ak-sysd troubleshoot check.

User names and IDs​

With libnss-authentik installed, the authentik Agent makes authentik users and groups available on the device. Their names and IDs are derived as follows:

ValueSource
User nameThe authentik username in lowercase, with @, /, and : replaced by -. For example, Jane.Doe@Company.com becomes jane.doe-company.com.
User IDThe user's uidNumber attribute, or else the connector's NSS User ID offset plus the user's numeric ID in authentik.
Primary group IDThe user's gidNumber attribute, or else the user ID.
Group IDThe group's gidNumber attribute, or else the connector's NSS Group ID offset plus the group's numeric ID in authentik.

Users log in with the converted user name. Their home directory is /home/<user_name> and their shell is /bin/bash.

To set fixed IDs, add uidNumber and gidNumber to the Attributes of a user or group. The values must be strings:

uidNumber: "20001"
gidNumber: "20001"

Users with a user ID or primary group ID below 1000, and groups with a group ID below 1000, aren't made available.

Conflicting users

If two or more authentik users have the same converted user name or the same user ID, none of them are made available on the device, and none of them can log in. For example, this happens for users named Alice and alice. Rename one of the users, or set unique uidNumber attributes.

To check whether a user is available on the device, run getent passwd <user_name>.

Enable SSH client authentication and CLI application authentication​

To enable initiating SSH connections and CLI application authentication, the device must be connected to an authentik deployment. To do so, follow these steps:

  1. Open a Terminal session and run the following command:
ak config setup --authentik-url https://authentik.company
  1. Your default browser opens the authentik login page. After you authenticate, the authentik Agent is configured.

View logs​

authentik Agent logs are available via the systemd journal (journalctl) or syslog, depending on the distribution. For example:

  • System agent: journalctl -u ak-sysd
  • User agent from the authentik-agent package: journalctl --user -u ak-agent

Report issues​

Please report issues and bugs via the authentik Platform GitHub repository.