Documentation

Up and running in minutes.

This guide walks you from a fresh Dirless account to a Linux host resolving users natively - no LDAP server, no FreeIPA, no SSSD.

Before you start

On this page
  1. Generate an age keypair
  2. Get your enrollment token
  3. Install the packages
  4. Enroll the host
  5. Start the agent
  6. Wire up the NSS module
  7. Add a user and verify
  8. ↳ Optional: sync from IAM Identity Center
Step 1

Generate an age keypair

Dirless uses age encryption to protect identity snapshots end-to-end. The private key never leaves your hosts - the backend only ever sees the public key.

Generate your keypair at dirless.com/age-keypair.html and save the downloaded private key file somewhere safe on each host you enroll (e.g. /root/dirless-age.key). You use the same keypair across your entire fleet.

Keep the private key safe. If you lose it, enrolled hosts will no longer be able to decrypt identity snapshots. Store a backup in a password manager or secure vault.

Step 2

Get your enrollment token from the portal

After signing up at portal.dirless.com, open your account dashboard. Note down two values you'll need:

  • Enrollment token - authenticates the host registration request
  • Backend URL - your unique subdomain, e.g. https://yourname.dirless.com
On non-EC2 hosts you'll also need your Tenant ID from the portal. On EC2, it is derived automatically from your AWS account ID.

Step 3

Install the packages

On the Linux host you want to enroll, add the Dirless RPM repository and install both packages:

Shell (RHEL / Amazon Linux 2023)
curl -fsSL https://dirless.com/rpm/dirless.repo \
  -o /etc/yum.repos.d/dirless.repo

dnf install -y dirless-cli dirless-agent

This installs dirless-cli (used once to enroll the host) and dirless-agent (the daemon that runs permanently). The agent package also installs libnss_dirless.so.2 and its systemd unit.

Not on RHEL/AL2023? Download standalone binaries instead:
curl -fsSL https://github.com/dirless/dirless-cli/releases/latest/download/dirless-cli-x86_64 -o /usr/local/bin/dirless-cli && chmod +x /usr/local/bin/dirless-cli

curl -fsSL https://github.com/dirless/dirless-agent/releases/latest/download/dirless-agent-x86_64 -o /usr/local/bin/dirless-agent && chmod +x /usr/local/bin/dirless-agent

Step 4

Enroll the host

Run dirless-cli enroll with your age key, enrollment token, and backend URL. This registers the host with your backend and writes everything the agent needs to /etc/dirless/ - including the agent config file.

On an EC2 instance (tenant ID auto-derived)
dirless-cli enroll \
  --age-key /root/dirless-age.key \
  --token <your-enrollment-token> \
  --server https://<yourname>.dirless.com
On any other host (bare metal, GCP, Azure, on-prem)
dirless-cli enroll \
  --age-key /root/dirless-age.key \
  --tenant-id <your-tenant-id> \
  --token <your-enrollment-token> \
  --server https://<yourname>.dirless.com

On success, enrollment writes two files to /etc/dirless/: age.key (your age private key) and hmac.key (the HMAC secret used to authenticate with the backend). It also writes a ready-to-use dirless-agent.toml with all values already filled in.

EC2 auto-derivation: On EC2, the tenant ID is derived from your AWS account ID via the instance metadata service. This means your syncer and agents automatically share the same backend identity without manual coordination.

Step 5

Start the agent

Enrollment already wrote /etc/dirless/dirless-agent.toml with the correct backend URL, HMAC secret, tenant ID, and age key path. Just enable and start the daemon:

Shell
systemctl enable --now dirless-agent

The agent connects to the backend, fetches the encrypted identity snapshot, decrypts it with your age key, and writes user and group data to /var/lib/dirless/local.db. It refreshes in the background every 60 seconds by default.


Step 6

Wire up the NSS module (binary install only)

RPM install: skip this step. The package automatically updates /etc/nsswitch.conf on install (backing up the original to /etc/nsswitch.conf.dirless-backup) and restores it on removal.

Binary install: add dirless to the passwd, group, and shadow lines in /etc/nsswitch.conf:

/etc/nsswitch.conf (relevant lines)
passwd:   files dirless systemd
shadow:   files dirless
group:    files dirless systemd

The dirless keyword maps to libnss_dirless.so.2. NSS lookups read from local.db directly - no network call, no daemon socket. If the backend is unreachable, lookups continue working from the last snapshot.


Step 7

Add a user and verify

Add a user through the Dirless portal (or wait for the syncer to pull one from IAM Identity Center if you've set that up). After the next sync cycle - at most 60 seconds - the user should resolve on the host.

Shell
# Check that the user resolves
getent passwd alice

# Check group membership
id alice

# List all Dirless-managed users
getent passwd | grep -v nologin

If you see the user's entry (with a UID in the 60000+ range), Dirless is working. The user now exists as a native Linux identity and can log in via SSH, run sudo, and appear correctly in ls -la output on shared filesystems.

User not appearing yet? Check journalctl -u dirless-agent -n 50 to see the agent's sync status. A fresh account has no users until you add one through the portal or configure the syncer.

Optional

Sync from AWS IAM Identity Center

If your team already uses AWS IAM Identity Center, the Dirless syncer pulls users, groups, and memberships automatically and pushes them to your backend. Portal-managed users and synced IAM Identity Center users coexist - you can use both at the same time. Skip this section if you don't have an IAM Identity Center directory to sync from.

The syncer must run on an EC2 instance inside your AWS account with an IAM role attached. It fetches credentials from the instance metadata service - no static AWS keys are ever stored.

IAM permissions required on the instance role:

IAM policy (JSON)
{
  "Effect": "Allow",
  "Action": [
    "identitystore:ListUsers",
    "identitystore:ListGroups",
    "identitystore:ListGroupMemberships"
  ],
  "Resource": "*"
}

Install and configure the syncer on the EC2 instance:

Shell
# Install
dnf install -y dirless-syncer

# Create config
cat > /etc/dirless/dirless-syncer.toml <<'EOF'
[backend]
url              = "https://<yourname>.dirless.com"
enrollment_token = "<your-enrollment-token>"

[syncer]
interval_seconds = 300
EOF

# Start
systemctl enable --now dirless-syncer

On first run the syncer uses the enrollment token to register with the backend, then begins pulling your Identity Center directory on the configured interval (default: every 5 minutes). The token can be removed from the config after the first successful run.

Once the syncer is running, any user or group change in Identity Center propagates to every enrolled Linux host within one sync interval. UIDs and GIDs are stable - they never change even if a user is removed and re-added.

What's next