website/docs/endpoint-devices/authentik-agent/agent-deployment/linux.mdx
import TabItem from "@theme/TabItem"; import Tabs from "@theme/Tabs";
You must configure your authentik deployment to support the authentik Agent.
If you have already created have an enrollment token, skip to the next section.
Follow these steps to install the authentik Agent on your Linux device:
<Tabs defaultValue="Debian-based"> <TabItem value="Debian-based">curl -fsSL https://pkg.goauthentik.io/keys/gpg-key.asc | sudo gpg --dearmor -o /usr/share/keyrings/authentik-keyring.gpg
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
sudo apt update
sudo apt install authentik-cli authentik-agent authentik-sysd
sudo apt install libnss-authentik libpam-authentik
Confirm that the authentik Agent is installed by opening a terminal window and entering the following command: ak
You should see a response that starts with: authentik CLI v<version_number>
:::note Headless server On a headless server, the system agent (sysd) does not start the user agent (ak-agent). You will need to manually start the user agent with this command:
systemctl start --user ak-agent
:::
</TabItem> <TabItem value="RedHat-based"># This overwrites any existing configuration in /etc/yum.repos.d/authentik.repo
cat <<EOF | sudo tee /etc/yum.repos.d/authentik.repo
[authentik]
name=authentik
baseurl=https://pkg.goauthentik.io
enabled=1
gpgcheck=1
gpgkey=https://pkg.goauthentik.io/keys/gpg-key.asc
EOF
sudo yum install -y authentik-cli authentik-agent authentik-sysd
sudo yum install -y libnss-authentik libpam-authentik
Confirm that the authentik Agent is installed by opening a terminal window and entering the following command: ak
You should see a response that starts with: authentik CLI v<version_number>
:::note Headless server On a headless server, the system agent (sysd) does not start the user agent (ak-agent). You will need to manually start the user agent with this command:
systemctl start --user ak-agent
:::
</TabItem> </Tabs>To enable device compliance features and the device accepting SSH connections, you must join the device to an authentik domain.
sudo ak-sysd domains join <deployment_name> --authentik-url https://authentik.company
deployment_name is the name that will be used to identify the authentik deployment on the device.https://authentik.company is the fully qualified domain name of the authentik deployment.On non-Debian Linux distributions, you currently need to manually configure NSS and PAM:
/etc/nsswitch.conf to include authentik for passwd, group, and shadow:...
passwd: files systemd authentik
group: files systemd authentik
shadow: files systemd authentik
gshadow: files systemd
...
/etc/pam.d/ directory. The order matters, both of these lines should be located above pam_unix in the respective files....
auth [success=2 default=ignore] pam_authentik.so
...
...
session required pam_authentik.so
...
To enable initiating SSH connections and CLI application authentication, the device must be connected to an authentik deployment. To do so, follow these steps:
ak config setup --authentik-url https://authentik.company
You can check the version of all installed authentik components by running the following command:
ak version
authentik Agent logs are available via the systemd journal (journalctl) or syslog, depending on the distribution.
Please report issues and bugs via the authentik Platform GitHub repository.