Paj Digital Labs
All articles
Hosting & Server Infrastructure

SSH Access for Small Teams: Offboarding Without a Server-Wide Panic

Shared private keys make access impossible to attribute or revoke cleanly. Give operators individual identities, limit privilege and verify that offboarding removes every supported route.

Paj Digital Labs 4 min read
Server racks and network cabling in a data center
Editorial illustration · Hosting & Server Infrastructure

A team shares one private SSH key because it is convenient. Six months later an operator leaves, and nobody can say which machines have the matching public key or whether the private key was copied. Convenience has become an inventory problem with root access.

Small teams do not need elaborate access infrastructure immediately. They do need individual identities, a deliberate privilege model and a revocation process that can be tested.

Inventory the entry routes

List hosts, bastions, VPN access, cloud consoles and automation accounts. Include emergency access and service deployment credentials. Removing one authorized_keys entry is incomplete if the same person still controls a cloud account that can replace it.

Record ownership and purpose for each identity. Humans, deployment automation and backup tools should not all use the same account. A key fingerprint helps identify a public key without exposing private material.

Never ask an operator to send their private key to prove which one they use. They can provide the public key and fingerprint. Private keys stay with their owner or approved secure automation environment.

Use individual accounts

Create named operator accounts and grant sudo privileges through reviewed groups or rules. Avoid routine login as root. Individual accounts improve attribution and let you disable one person without changing everybody's workflow.

Generate keys using a supported modern algorithm and protect private keys with an appropriate passphrase or hardware-backed method. Hardware security keys can reduce key-copying risk, but compatibility and recovery need testing across your clients and servers.

SSH certificates with short lifetimes can simplify larger fleets. They also create a certificate authority that must be protected. An ordinary team can begin with individual public keys while it develops the inventory and ownership required for a certificate-based design.

Limit each identity to its job

A deployment account may need to write release files and restart one service, not run every command as root. Review sudo rules carefully. Allowing a command with arbitrary arguments, writable configuration or shell escape features can grant far more privilege than its name suggests.

Automation keys can use authorized_keys restrictions such as a forced command, source-address restrictions and forwarding controls where appropriate. The exact options depend on OpenSSH version and the integration. Test both legitimate operation and forbidden alternatives.

Do not apply a restriction you cannot explain. A forced command script that evaluates supplied shell text can undo the protection immediately.

Change authentication without locking yourself out

Keep an existing trusted session open while changing SSH configuration. Verify syntax before reload and test a second connection through the real access path.

bash
sudo sshd -t
sudo sshd -T | grep -E class="text-code-string">'passwordauthentication|permitrootlogin|pubkeyauthentication'

These commands check configuration and display effective settings in a general context. Match blocks can alter settings by user or address; use the supported test-context options to inspect the relevant case. Service names differ across distributions, so use the host's actual reload mechanism.

Disabling password login is useful only after approved key-based access and recovery are working. Also review keyboard-interactive and PAM configuration where applicable; one disabled option does not necessarily describe every authentication route.

Make offboarding a sequence

  • Identity provider or VPN — Remove access and active sessions
  • Host login — Disable relevant accounts and remove authorised keys
  • Privilege — Remove sudo or group memberships
  • Cloud control plane — Revoke console and API access
  • Shared secrets — Rotate only those the person could access
  • Automation ownership — Transfer jobs and credentials deliberately

Disabling future login does not automatically terminate existing sessions or processes. Decide how to handle those through your organisation's policy and operational needs. Inspect active sessions before making disruptive changes.

If a shared key existed, treat every holder as a potential copy. Replacing only the file on one laptop does not revoke copies elsewhere. Rotate the affected shared credential and remove its public key from the complete inventory.

Verify the denial

Use an approved test to confirm the revoked identity cannot enter through the normal route, including the bastion and destination host. Do not test by retaining or borrowing the former operator's private key. Use managed identity controls and authorised verification methods.

Confirm remaining operators can still work and that emergency access is intact. Check that deployment jobs did not accidentally depend on a human account. A successful offboarding should not break unrelated automation.

Review logs using fingerprints and account names, while recognising their limitations. A shared account with shared credentials cannot retrospectively provide individual attribution you never recorded.

Keep recovery accountable

Maintain a controlled emergency route with a documented owner and audit trail. Test it periodically. An undocumented permanent root key hidden in a notes app is not a recovery plan.

The durable improvement is separation: one identity per person, a distinct identity per automation purpose, and a known owner for every privileged route. Then revocation becomes a precise access change instead of a fleet-wide scramble to replace a secret nobody should have shared.

Paj Digital Labs

The engineering journal of Paj Digital Solutions — hosting, server infrastructure and web engineering, written by the people who run the servers.

Related reading