The Definitive Guide to Linux Authentication

Peter CummingsPeter Cummings
••Updated •17 min read
The Definitive Guide to Linux Authentication

Every established way onto a Linux host, what each one costs on every server, where it breaks, and what I'd change now. 

Ask a team how people log in to their Linux hosts and you'll get one answer. Ask the hosts and you could get five. 

Passwords nobody turned off. Keys nobody remembers adding. A domain join, a vault in front of it, and a playbook quietly writing sudoers underneath. Every method we ever adopted is still switched on, stacked on the one before. Nobody retires the old way in. We add a shinier one next to it. 

So here's the whole picture. I've called it definitive, which is an invitation to tell me what I got wrong. 

No method gets everything right. The answer isn't a better method. It's one way in, plus one place that decides what happens after it.

In this guide:

How a Linux login actually works 

One trap before we start. On a Linux host, PAM means Pluggable Authentication Modules (/etc/pam.d), not privileged access management, the vault-and-broker product category that shares the acronym. In this guide, PAM is always the Linux one. 

Four pieces decide every SSH login, and every method below plugs into one or more of them. 

  • sshd checks the credential: a key or certificate itself, a password through PAM. 
  • The name service (NSS) says who the account is, from local files first and then any directory client, such as SSSD. 
  • PAM decides whether that account may log in, and opens the session. 
  • sudo decides what it can do next. Strictly, that isn't authentication. It's in this guide because it's where most of the damage lives. 

First, whose account is it? 

Under every method sits one decision: does a login belong to one person (or one workload), or to whoever knows the secret? 

My view: personal. Always. 

Shared accounts have a case: fewer accounts, software that insists on oracle, one secret to hand over at 2am. But a shared root password is five people pretending to be one. The log says deploy did it, and you can't ask deploy what it was thinking. Every leaver means rotating for everyone. The directory can't help, because SSSD only checks the account that's logging in, so a key on a shared, service or local account survives the departure of whoever holds it. And PCI DSS allows shared IDs only by exception, admin and root included. 

So people log in as themselves and elevate with sudo. An account with five keys in its authorized_keys file is a shared account, whatever its name says. Break-glass is the only shared secret I'd keep: console only, vaulted, checked out by name, rotated after use and alarmed. 

Every method on one page 

Every method puts something on each server and depends on something being reachable, so that's the fair comparison. Yes means out of the box. Partly means an add-on, extra configuration or a catch. No means it can't on its own. These are my calls. SSSD and Winbind share a row because they behave alike here. 

Linux authentication, scored
What each method costs, how it copes with outages and leavers, and what happens after login
Yes: out of the box. Partly: add-on, extra configuration or a catch. No: not on its own.
What it costsOutages and leaversAfter login: privilegeKeys, proof, agents
MethodLittle change to the directoryLight on each serverLogin with the directory downLeaver out everywhere, fastSudo managed centrallySudo assigned per person or roleTime-boxed, with approvalSSH keys have a lifecycleCentral evidenceFit for AI agents
Local passwords over SSHYes
no directory needed
Partly
an account on each host
Yes
local check
No
every host, by hand
No
a file on each host
Partly
per host, by hand
No
sudo end dates at most
No
keys sit alongside
No
each host's logs
No
a secret it can read and reuse
Static SSH keysYes
no directory needed
Partly
key files on each host
Yes
no live check
No
every key file, by hand
No
whatever the account has
Partly
via the account it opens
No
expiry rarely set, no approval
No
no owner, no expiry
No
fingerprints in each host's log
No
a file it can copy or plant
Domain join (SSSD, Winbind)Partly
computer accounts, stored IDs
No
join, Kerberos, SSSD, NSS, PAM
Partly
cached users only
Partly
next online check; caches linger
Partly
schema or files; not sudo-rs
Yes
user, group, host
No
sudo end dates at most
No
unmanaged
No
AD history, server logs
Partly
standing service secrets
Direct LDAP clientsPartly
Unix attributes on everyone
Partly
no join; NSS and PAM
No
weaker caching than SSSD
Partly
passwords stop, keys don't
Partly
schema or files; not sudo-rs
Yes
user, group, host
No
sudo end dates at most
No
unmanaged
No
AD history, server logs
Partly
standing service secrets
IdM with AD trustNo
forest trust, by AD admins
No
enrolment, SSSD, Kerberos
Partly
cached users only
Partly
as domain join
Yes
IdM rules; not sudo-rs
Yes
user, group, host
No
sudo end dates at most
Partly
stored, no lifecycle
No
IdM, server logs
Partly
standing service secrets
Commercial AD bridgesPartly
computer accounts, IDs to design
No
vendor agent, still a join
Partly
local caches
Partly
as domain join
Partly
vendor tooling or GPO
Yes
AD groups, vendor roles
Partly
generally standing
No
unmanaged
Partly
mature vendor reporting
Partly
standing service secrets
Local accounts via configuration managementYes
a custom export
Partly
account, key, sudoers files
Yes
unaffected
Partly
next successful run, each host
Yes
sudoers from Git
Yes
user, group, host
No
sudo end dates at most
Partly
pushed, no lifecycle
Partly
Git for changes, run logs for use
No
its account is standing root
SSH certificates and gatewaysYes
IdP can sit on AD
Partly
CA trust; accounts still needed
Partly
issuing needs the IdP
Partly
certificates age out, accounts stay
No
login only
Partly
via principals
Partly
the login, not the sudo rule
Yes
short-lived by design
Partly
key ID in each host's log
Yes
per task, minutes, scoped
Privileged access vault + session brokerYes
connects to AD
Partly
accounts still needed; elevation agent
Partly
needs the broker up
Partly
at the broker; side doors stay
Partly
separate elevation agent
Partly
same add-on
Yes
checkout windows, approvals
Partly
vaulted keys only
Partly
recordings of what passes through
Partly
built for people typing
Cloud-native accessYes
cloud IAM instead
Partly
cloud agent, per cloud
Partly
needs the cloud's control plane
Partly
per cloud; open sessions stay
Partly
via IAM role
Partly
admin or not
Partly
grants expire, open sessions don't
Partly
short-lived if you enforce it
Partly
cloud audit log, not the host's
Partly
run-command is root

Peter Cummings, “The Definitive Guide to Linux Authentication”, November 2026

 

  • No row is all yes. 
  • The least fashionable row has the most yeses. Configuration management gets four: it asks little of AD, needs nothing from it at login, and keeps sudo in Git. It pays later, because a leaver stays until the next successful run on every server. The whole table makes that trade: whatever keeps logins working in an outage (a cache, a local file) keeps a leaver working too. 
  • Read the time-boxing column twice. sudo can put an end date on a rule, but nothing that manages sudo grants it on request or asks for approval, and the one clean yes usually needs a separate elevation product for sudo. 

One thing settles the question on its own: Kerberos single sign-on, NFS with Kerberos and Samba file servers enforcing AD permissions all need a domain join or an IdM trust. 

Where most estates start 

Passwords over SSH 

The one everybody has turned off, except on the appliance and the "temporary" jump host. 

  • Strengths: works everywhere, including the console when the directory is down, which is why break-glass still uses one. Can sit behind an MFA prompt through a PAM module. 
  • Weaknesses: phishable, guessable, reusable and shareable. Upstream they default to yes, and a drop-in file you didn't know about can beat the main file you fixed. 
  • Change now: PasswordAuthentication no everywhere, then check the effective setting with sshd -T. 

Static SSH keys 

Stronger than passwords. Also immortal. 

  • Strengths: strong cryptography, nothing to brute-force, and every tool on earth speaks it. No live check, so logins survive directory outages. With a FIDO2 security key (OpenSSH 8.2 and later), the private key never leaves the hardware. 
  • Weaknesses: no owner, no context and, unless someone adds one, no expiry. Anyone who can write to an authorized_keys file can grant access, including to themselves, and no directory, vault or review sees it. 
  • Change now: put a name next to every key, root's included, and disable the unclaimed. Move keys to a root-owned path (AuthorizedKeysFile /etc/ssh/authorized_keys/%u). Give people FIDO2-backed keys, and pin automation keys with restrict, from= and expiry-time=. 

Seven ways to connect Linux to Active Directory 

Most of you already have AD deciding who's who, and you want it to decide who reaches which Linux servers, with what privilege. There are seven established ways to do that. 

Most make one design choice: each server becomes a participant in the directory, resolving users and groups through a local stack of SSSD or Winbind, Kerberos, the name service and PAM. That design is proven. It also puts its costs on every server, and the approaches that avoid it bring trade-offs of their own. 

1. Domain join with SSSD 

realm join creates a computer account in AD and a Kerberos keytab. SSSD then resolves users and groups and authenticates them over Kerberos, through the name service and PAM. Login rights come from access filters or GPO. Unix IDs are calculated from Windows SIDs, or read from uidNumber and gidNumber in AD. 

  • Strengths: the default path on Red Hat-family, SUSE, Debian and Ubuntu, well documented and free. Kerberos single sign-on and smart cards. Cached logins through an outage. No extra servers. 
  • Weaknesses: moving parts on every server that must stay consistent, and it controls login and little else. 
  • Change now: a realm join usually lets any domain user log in, so start from realm deny --all, then realm permit -g per host class. Set offline_credentials_expiration to something you can defend. 

Put IGA reviews on top and you have genuine governance. But the review certifies a name, and the host decides what it means. linux-admins could mean NOPASSWD: ALL on three hundred hosts and nothing on twelve, and the review would never know. 

2. Domain join with Samba Winbind 

winbindd joins the domain and provides users, groups and authentication. 

  • Strengths: required where Linux is an AD-integrated Samba file server enforcing Windows ACLs. NTLM where legacy clients need it. 
  • Weaknesses: SSSD's operational profile: a join, caches and Kerberos. Its ID mapping is configured differently too, so mixing the two without a plan gives the same user different UIDs. 

3. Direct LDAP clients (nss-pam-ldapd and similar) 

The server queries AD over LDAP and authenticates with LDAP binds or Kerberos. No domain join, no machine account. 

  • Strengths: simple. Suits small or legacy estates. 
  • Weaknesses: every user and group needs Unix attributes maintained in AD. Offline logins and caching are weaker than SSSD's. Red Hat has removed it from RHEL and says to migrate to SSSD. 

4. FreeIPA / Red Hat IdM with an AD trust 

A Linux identity domain on its own replicated servers, linked to AD by a cross-forest trust. Servers enrol in IdM and run SSSD against it, and access and sudo rules apply to AD users and groups through the trust. Red Hat says to consider this past 30 to 50 systems. 

  • Strengths: Linux-native central policy for login and sudo. Kerberos single sign-on. SSH public keys. Passkeys since RHEL 9.4. 
  • Weaknesses: a second identity infrastructure to run, patch, back up and replicate. A forest trust AD administrators must set up and maintain. Clients still depend on SSSD and its caches. No built-in request and approval, and time limits stop at an end date on a sudo rule. 
  • Change now: replace the allow_all access rule it ships with. 

5. Commercial AD bridges 

Delinea Server Suite, BeyondTrust AD Bridge, One Identity Safeguard Authentication Services. A vendor agent joins each server to AD, usually adding Group Policy for Linux settings and tooling for configuration and reporting. 

  • Strengths: vendor support across distros. Familiar Group Policy tools. Mature reporting. 
  • Weaknesses: per-server licensing. Still a domain join: machine accounts, local caches, dependence on Kerberos and domain controllers. Unix ID mapping still has to be designed. Access is generally standing rather than time-boxed. 

6. Local accounts via configuration management 

Ansible, Puppet or Chef create local accounts, authorized_keys and sudoers files from data a script pulls out of AD. In plenty of estates this is the actual access system, whatever the architecture slide says. In a poll we ran on what people would defend in an audit, nobody picked it. A playbook comes with a Git log, and I have never seen an auditor's face light up at a YAML file. 

  • Strengths: no directory dependency at login, so it's resilient. Every change has a commit, an author and, if you're disciplined, a reviewer. 
  • Weaknesses: the sync from AD is custom code you own forever. A leaver keeps access until the next successful run on every server, and failed runs and drift leave stale access behind. Keys get pushed but have no lifecycle. No approvals, and the audit trail is spread across run logs. Whoever can merge to main approves your root access. The automation account can become root wherever it runs, and Ansible's own documentation says you can't limit that to certain commands. 
  • Change now: make declared equal actual, purging what the repo doesn't own. Protect the access repo like Tier 0. Treat drift as an incident. 

7. SSH certificate authorities and gateways 

People get a short-lived SSH certificate after signing in to an identity provider that can be backed by AD. Servers trust the CA through sshd's configuration, and some products route sessions through a central gateway. 

  • Strengths: no long-lived personal keys. Leavers age out and stolen certificates go stale. sshd logs the key ID, so each login ties back to a name. Strong session controls where there's a gateway. 
  • Weaknesses: a certificate maps to a Unix account that must already exist, so accounts, UIDs and sudo still need another method. Every server needs the CA configured. A gateway sits in the path of every session. The CA's signing key becomes the most valuable secret you own. 
  • Change now: cap lifetimes at hours for people, minutes for automation and agents. Put the owner in the key ID. Then close the old path with AuthorizedKeysFile none, confirmed with sshd -T. Until you do, every old key still works. 

In front of the host 

Privileged access management: vault + session broker 

This is the other PAM. It isn't one of the seven because it does a different job. A vault and session broker decides who may check out a credential or open a session. It doesn't put accounts, UIDs or sudo rules on the host. Something above still does that. 

  • Strengths: credentials people never see, rotated after use, with recordings and approvals that make the best audit evidence here. 
  • Weaknesses: the broker sees only what goes through it. Direct SSH with a key, the automation account, the CI runner and the cloud's run-command don't, so none are in the recording. A recording is a very good witness and a very bad bouncer. And just-in-time is mostly still a plan: in a survey CyberArk published in January 2026 (500 US practitioners), 1% had fully implemented it. 
  • Change now: make hosts accept SSH only from the broker's addresses, then compare sshd's accepted logins with the broker's session log. Every login the broker never saw is a door you didn't know about. 

Cloud-native access 

AWS Session Manager, Google OS Login, Entra ID login for Azure VMs and, on the host side, Ubuntu's authd and Himmelblau. The cloud's IAM decides who gets a shell. 

  • Strengths: often no inbound SSH and no long-lived keys (OS Login's certificates expire after five minutes). 
  • Weaknesses: every cloud differs, and the control plane is a path to root that never touches sshd. AWS says anyone allowed to send commands to its SSM Agent has root on Linux. 
  • Change now: scope session and run-command permissions, with no wildcards, and send those events where sshd's logs go. 

Where directory-joined Linux struggles 

I'd bet SSSD is the most common way to put Linux on AD, though nobody publishes market share to prove it. It's the reference here. Winbind and the bridges show the same patterns, because they share the design. 

SSSD is free the way a puppy is free. It's tempting to blame open source for what follows, but closed agents hit the same walls. BeyondTrust's release notes say RHEL 9 in FIPS mode needs a crypto policy change or AD authentication fails. Open source explains why the builds differ. The design explains why this is hard. 

Unix IDs and the schema 

  • Calculated IDs agree only between servers configured identically. Anything calculating differently (Winbind with another backend, NFS servers, appliances) sees different owners on the same files. 
  • Stored IDs need a unique number for every user and group. AD doesn't enforce that, so a process has to. 
  • Sudo rules or SSH keys in AD need schema extensions, which are forest-wide and can't be removed. Many AD teams decline, which pushes both back into per-server files. 

Configuration 

  • Every distro ships a different one. A mixed estate could be running SSSD 1.16 on RHEL 7, 2.9 on Ubuntu 24.04, 2.10 on Debian 13 and 2.12 on RHEL 10, all at once. The wiring differs too: authselect on Red Hat, pam-auth-update on Debian and Ubuntu, pam-config on SUSE. One PAM error can lock everyone out of a server. 
  • Builds change behaviour. In one report, identical config logs in within four seconds on CentOS and takes six to over fifty on Ubuntu. 
  • Trust can break. SSSD rotates the machine password every 30 days by default. A server restored from an old snapshot, or offline too long, can lose its trust relationship. 

Caches and availability 

  • Changes lag. Identity data is cached for 90 minutes by default (entry_cache_timeout = 5400), so a group change can take that long to reach a host unless someone clears the cache there (sss_cache -E). A fresh login on a connected host refreshes that user's groups. Anyone already logged in is working from the old answer. 
  • Cached passwords outlive AD. A realm join turns on credential caching, and by default cached credentials never expire (offline_credentials_expiration = 0). Someone disabled yesterday could still log in on a server they've used before that can't reach a domain controller. The cache that gives you resilience undermines revocation. 
  • Logins depend on the domain. Speed and success hang on domain controller reachability, DNS, AD sites and clocks within Kerberos's five-minute limit. 
  • Failures are local and intermittent. You diagnose them one server at a time, from debug logs. A thread on SSSD's tracker, open since 2023, describes a backend that stays offline until someone restarts the service. One Hacker News commenter calls the stack "incredibly byzantine". Forums over-sample pain, so these are themes, not rates. 

Governance and evidence 

  • All or nothing. A join answers one question: may this account log in to this server? Time limits, approvals, SSH keys and break-glass are left to other tools. 
  • sudo is ungoverned. It's a distributed file or a schema-extended directory object, and neither has a safeguard against a rule that reaches every server. In plain LDAP, set ldap_sudo_search_base, or anyone who can write to any subtree could plant a root rule (CVE-2026-14474). And since 25.10, sudo on Ubuntu means sudo-rs, which reads sudoers files and nothing else. 
  • Joining retired nothing. Local accounts, local sudoers and authorized_keys files all still work, and SSH keys are invisible to AD. 
  • Revocation is passive. Disabling an account pushes nothing out. Each host finds out when it next asks, and open sessions carry on. 
  • Evidence is scattered across AD change history and each server's logs. 

To be fair, people running a handful of servers call it easy, and a well-run SSSD estate controls login dependably. What it takes is specialist SSSD, Kerberos and PAM skills, a permanent orchestration layer and ongoing effort on caches and trust. And it still doesn't govern privilege, keys, time or approvals. 

What that orchestration layer has to do 

Every approach has a control plane. In a joined estate it's AD, its domain controllers and your configuration management. The open automation stops at "joined and configured": as far as I can tell, none of it checks fleet health or works out who can actually log in. Buy it or build it, I'd hold it to this. 

  • Know every host. Distro, SSSD build, wiring tool, crypto policy, online status, adcli testjoin, machine password age. 
  • No reusable join secret. A join account limited to one OU and a one-time password per host. 
  • One intent, rendered per build. Options generated per version, PAM and nsswitch changed only through the native tool. 
  • Prove each change, in rings. sssctl user-checks walks the real PAM path, but read the output: in the current source it exits with success even when PAM says no. Restore the last good config automatically. 
  • Close the lifecycle. Computer accounts pile up, and realm leave keeps them in AD unless you ask it not to. 
  • Gate OS upgrades. Red Hat warns AD authentication might be broken after a RHEL 7 to 8 in-place upgrade. 
  • Answer the audit question per host. An Ask Ubuntu question on listing everyone who can SSH into a server has 215,000 views, and its top answer starts with cat /etc/passwd, which has never heard of your directory. 
  • Don't become the next root-on-everything. Anything that writes PAM on every host is Tier 0. Keep agents off its write path. 

The case for just-in-time 

Every method above shares one habit: access that exists whether anyone is using it or not. The sudo rule written during an outage and never taken out. The automation account that's root around the clock for a job that runs twice a week. 

Just-in-time provisioning reverses the default. Nothing exists until a job needs it: not the login, not the account on that host, not the sudo rule. When the job ends, they go too. The identity stays permanent and personal. Its presence on a given host, and what it may do there, doesn't. 

So far, most just-in-time effort has gone into logins. Behind them, the sudo rule is usually as permanent as ever. 

  • Standing access is what gets used. A grant that lasts an hour is worth an hour to whoever steals it. 
  • It's the lever you nearly always have. Sometimes a job needs root. You can nearly always shrink how long it has it. 

The JIT system goes down? Put the end time in the grant itself. People approve everything? Then cap them: a 30-day grant is standing access with a calendar reminder. 

Change now: 

  • Count who can sudo on each host, and who actually did in the last 90 days. The gap is your just-in-time list, and much of it is your deletion list. 
  • Use what you have. A sudo rule can carry an end date: NOTAFTER= in a sudoers file, sudoNotAfter in LDAP and IdM. Test it: an expired rule is only skipped, so an older matching rule keeps working, and sudo-rs refuses NOTAFTER= and drops the rule. 

What agents change 

Every method above was designed for a person who logs in, does a job and logs out. A growing share of what logs in now isn't a person. 

An agent inherits whatever is lying around. One in a developer's terminal can use that developer's loaded SSH keys and cloud profiles. In July 2025 a prompt slipped into Amazon's Q Developer extension told the agent to wipe the machine and delete cloud resources with the AWS profiles it found. It failed on a syntax error. That was the safety margin. And what it reads could steer it into misusing legitimate access. The login was real. 

Scope and time are the two limits that don't depend on the agent behaving. One identity per agent with a named human owner, a certificate per task measured in minutes, no standing sudo rule. 

What I'd measure 

On its own, none of these methods tells you who can do what on your Linux hosts, right now. 

The posture I'd aim for: personal identities only. One way in per kind of identity, every other way verifiably off. Least privilege after the door, and none of it standing. AD stays the source of truth for who's who. The host is where the access actually is, so compare the two continuously, not once a quarter. 

These tell you how it's going: 

  • Time from disabling an account in AD to access ending on every server. 
  • Standing privileged grants and sudo rules. 
  • SSH keys nobody can account for. 
  • Login incidents caused by directory reachability or caches. 
  • How quickly and completely you can answer an audit request. 
  • Logins your hosts accepted that none of your systems of record can explain. Get that one to zero. 

No auditor in the room: how many of these are still switched on in your estate? 

 

Peter Cummings

Peter Cummings

Security architecture at Mastercard, EY, UBS, Lonza, and UK Government agencies.

Peter Cummings — IT Security & AI expert with 20+ years’ experience. Founder of LinuxGuard. Passionate about automation, least privilege, and scalable cloud solutions.