Glossary

Authentication

Authentication is the process of verifying an identity: confirming that the person, device or program making a request is really the one it claims to be.

How is authentication different from authorization?

Authentication answers who you are. Authorization answers what you may do. A login form authenticates you; the check that decides whether you can open the billing page authorizes you. They are often mixed up because they happen one right after the other, but they fail in different ways. Weak authentication lets the wrong person in; weak authorization lets the right person do the wrong thing, such as a regular user reaching admin endpoints by changing a URL. Accounting, the third leg, records what each identity did afterward.

What methods prove an identity?

MethodWhat is checkedTypical use
PasswordA secret the user knows, compared with a stored hashWeb apps, console logins
Public keyA signature made with a private key the user holdsSSH, Git, code signing
CertificateA key pair vouched for by a certificate authorityMutual TLS between services, VPNs, Wi-Fi
TokenA signed or random value issued after an earlier loginAPI keys, session cookies, bearer tokens
PasskeyA key pair bound to a site and unlocked by the devicePasswordless web logins
One-time codeA code from an app, message or hardware tokenSecond factor

Combining two methods from different families is Multi-Factor Authentication.

How does Linux authenticate a login?

Through Pluggable Authentication Modules (PAM). Each service, such as sshd, sudo or login, has a file in /etc/pam.d/ listing modules to run: check the password against /etc/shadow, ask for a one-time code, verify against LDAP, enforce account expiry. SSH adds its own layer: with public key authentication, the server sends a challenge, the client signs it with the private key, and the server checks the signature against ~/.ssh/authorized_keys. The private key never leaves the client.

grep -E '^(PasswordAuthentication|PubkeyAuthentication|AuthenticationMethods|PermitRootLogin)' /etc/ssh/sshd_config /etc/ssh/sshd_config.d/*.conf
journalctl -u ssh --since "-2h" | grep -E 'Accepted|Failed|Invalid user' | tail -20
lastlog -t 30 | head

The first line shows which methods the SSH server allows. The second lists recent successes and failures; on AlmaLinux and Rocky Linux the unit is sshd instead of ssh. The last shows who logged in during the past month. SSH keys explains the key pair setup.

How do apps authenticate users at scale?

Instead of each app keeping its own password table, most organizations put logins in one identity provider and let apps trust it:

  • OpenID Connect (OIDC): built on OAuth 2.0; the app redirects to the provider, which returns a signed ID token after login. Common for modern web and mobile apps.
  • SAML 2.0: XML-based assertions, widespread in older enterprise software.
  • LDAP: a directory that apps query to check passwords and read group membership.
  • Kerberos: ticket-based authentication inside a domain, used by Windows networks and some Linux shops.

Single sign-on built on these means one strong login, with MFA, protects every connected app, and removing a departing employee from one directory removes their access everywhere.

How do services authenticate to each other?

Machines need identities too. A web app connecting to its database uses a dedicated database user and password, ideally stored outside the code. Services across machines can use mutual TLS, where both sides present certificates from your own CA. Webhooks often carry an HMAC signature so the receiver knows the request came from the sender with the shared secret. API clients send tokens with an expiry and a narrow scope. Each of these should be unique per service, so one leaked credential does not open everything.

What makes a good session after login?

Authentication happens once, but the session cookie that follows is what proves identity on every later request, so it deserves the same care. Mark it Secure, HttpOnly and SameSite=Lax or stricter, issue a fresh session ID right after login to block fixation attacks, and set both an idle timeout and an absolute lifetime. Store sessions server side or sign them, and give users a way to see and end their active sessions. Logging out should destroy the session on the server, not just delete the cookie in the browser.

Which practices make authentication stronger?

  • Store passwords only as slow salted hashes such as Argon2id or yescrypt; see Hashing.
  • Rate limit and lock out repeated failures; Set up fail2ban does this for SSH and web logins.
  • Prefer keys, passkeys and certificates over passwords wherever possible.
  • Give each human and each service its own identity, never a shared account.
  • Log every success and failure and review unusual patterns.
  • Expire and rotate tokens and keys, and revoke them immediately when someone leaves.

Which machines suit an identity provider?

Identity servers are light on CPU but important, so run two. A pair of S1 machines in Ashburn and Amsterdam, each with 64 GB DDR4, gives a fast, redundant sign-in service for a sizable team. A small LDAP or RADIUS server fits on the E1 at $30.52 a month.

Machines for Identity and Directory Services

ServerProcessorCores / threadsMemoryStorageNetworkPer monthSmallest order
E1Intel Xeon E3-1240 v34 / 816 GB DDR32x 240 GB SSD2x 1 Gbps$30.52$91.56 (3 months)
S1Intel Xeon E-2276G6 / 1264 GB DDR41x 1 TB NVMe2x 10 Gbps$53.32$53.32 (1 month)
S2Intel Xeon E-2356G6 / 1264 GB DDR41x 1 TB NVMe2x 10 Gbps$58.39$58.39 (1 month)

Keep Reading

Multi-Factor Authentication

Logins that need two or more independent proofs of identity, the factor types compared by strength, and adding MFA to SSH and web apps.

Open

SSH keys

How SSH key pairs replace passwords, how to make an ed25519 key and how to have it placed on your machine at install time.

Open

Log in with an SSH key

Create an ed25519 key, install it on your machine through the panel or ssh-copy-id, and log in without typing the root password.

Open

Set up fail2ban

Install fail2ban, write a jail.local for SSH and nginx, read the ban list and unban an address you locked out by mistake.

Open

FAQ

Quick Answers

Authentication confirms who you are. Authorization decides what you are allowed to do once your identity is known.

The server sends a challenge, the client signs it with its private key, and the server verifies the signature with the public key in authorized_keys.

Pluggable Authentication Modules, the Linux framework that lets each service define which checks a login must pass.

Both provide single sign-on. OIDC uses JSON tokens and suits modern apps; SAML uses XML assertions and is common in older enterprise software.

With unique per-service credentials such as mutual TLS certificates, scoped tokens or HMAC-signed requests, rotated regularly.