skip to content

You must give forty carriers SFTP drop folders on OpenSSH — how do you weigh one shared account, per-carrier chrooted accounts and a dedicated drop host?

level: principalimportance: should knowfreq 14%

answer

  1. identity is the unit of revocation
  2. one jail per identity
  3. whose policy is global
  4. logs that name the sender

basics

~20 s

Give each carrier its own account in one chrooted, forced-SFTP group, with its own restricted key, and prefer a host or sshd instance whose global policy is the transfer policy; a shared account loses revocation, attribution and isolation.

solid answer

~50 s

A shared account is cheapest and worst: every carrier sees every folder, one leaked key exposes all of them, and revoking one carrier means re-keying forty. Per-carrier accounts in one group, each with `ChrootDirectory %h`, `ForceCommand internal-sftp`, a `restrict,from=` key and its own log identity, make the account the unit of isolation, attribution and revocation, at the cost of account lifecycle work. Where those accounts live is the second choice: a Match block on a server that also serves staff shells works, but one wrong line can hand partners a shell or a tunnel; a dedicated host or sshd instance lets the global configuration itself be the transfer policy, with a smaller network reach. Most teams end at per-carrier accounts on a dedicated drop host, with transfer logs routed centrally and files moved out of the drop by a pipeline.

go deeper

for a junior

Know that each partner gets its own account and jail, because that is what allows one partner to be cut off without touching the others.

for a middle

Explain how the chroot, forced internal-sftp and per-key options combine for each account, and how internal-sftp logs attribute files to accounts.

for a senior

Compare the failure modes: a Match mistake on a shared server fails open, a dedicated host fails closed, and lifecycle work grows with every partner.

for a principal

Own the tradeoff between operating another host and the blast radius of a mistake, set the bar for when a pilot moves to dedicated infrastructure, and make onboarding and offboarding single auditable changes.

## The decision Offering file drops to many outside parties is a design question with three axes: **what an identity is** (one shared account or one per carrier), **where the policy lives** (a Match block on a shared server or a host whose whole configuration is for transfers), and **what happens to a file after it lands**. The OpenSSH mechanisms are the same in every option — `ChrootDirectory`, `ForceCommand internal-sftp`, `DisableForwarding`, `restrict` and `from=` on keys, `internal-sftp -l` logging — but the options differ sharply in how they fail. ## Comparing the options | Concern | One shared account | Per-carrier accounts, Match block on a shared server | Per-carrier accounts on a dedicated drop host | |---|---|---|---| | Isolation between carriers | none: one jail for all | one jail each | one jail each | | Revoking one carrier | re-key everyone | delete one account or key | delete one account or key | | Attribution in logs | address only | user name per session and file | user name per session and file | | Cost of a config mistake | all carriers exposed | partners may reach staff-level access | limited to the drop host | | Operating cost | lowest | moderate | highest: another host to run | ## Why the account should be the carrier - **Revocation.** When a carrier ends the contract or reports a leaked key, removing one account or one key line should be the whole action. With a shared identity it is a coordinated re-key of every partner. - **Isolation.** `ChrootDirectory %h` gives each account its own root; with one account, every carrier can read and overwrite every other carrier's files. - **Attribution.** `internal-sftp -l INFO` logs session open and close with user and address, and every file opened and closed with byte counts. With one identity per carrier, that log answers "who sent this file?" without guesswork. - **Per-carrier limits.** `from=` on each key can pin that carrier's egress range; `-R` or a `-P` deny list can differ for a carrier that only collects files. The cost is lifecycle work: forty accounts, forty keys, forty jails. At that scale the files and keys are usually managed from a central source; how keys reach many servers is covered by the material on operating OpenSSH, and does not change this design. ## Why the host matters On a server that also serves staff shells, every partner protection is a Match block. Match blocks have no end marker, the first value obtained wins, and the manual itself warns that `ForceCommand` does not stop forwarding. A small mistake therefore fails **open**: partners might get a shell or a tunnel into networks the staff host can reach. A dedicated drop host (or at least a separate sshd instance with its own configuration file) inverts that: 1. The global section is the transfer policy: `DisableForwarding yes`, `PermitTTY no`, `ForceCommand internal-sftp`, key-only authentication. 2. A mistake in a Match block can only loosen a transfer server, not a shell host. 3. Network reach can be cut to what the pipeline needs, which limits a tunnel even if forwarding were ever reopened. ## After the file lands - **Move files out.** A pipeline should move or copy uploads from each `upload` folder into an internal area the carriers never see, so the drop holds only in-flight files. Its access goes on the upload folders, never on the root-owned jail path. - **Contain disk use.** Putting the jails on their own filesystem stops one carrier's runaway upload from filling the host's system volume. - **Centralise logs.** A dedicated facility on each `internal-sftp` line lets the syslog daemon forward transfer logs; in a per-carrier jail layout, some systems need a log socket inside every jail. Whether carriers push to you or you pull from them flips who runs the server; the client side of that, including atomic upload patterns, is the automation material's subject. ## No single right answer A pilot with two carriers can live on a Match block with careful tests. A long-lived service for dozens of outside organisations usually justifies its own host. What stays constant is the principle: one identity per carrier, policy that fails closed, and logs that name the sender.

  • Forty carriers grows to four hundred. What in this design starts to hurt first?
    Lifecycle, not sshd: creating and removing accounts, jails and key lines by hand, plus one log socket per jail on systems that need it. The answer is to generate them from a central record of carriers, keys and address ranges, so onboarding and offboarding are one change each.
  • A carrier asks for one account for its three subsidiaries. Do you agree?
    Usually not: three accounts keep revocation, attribution and isolation per legal entity, which is the reason for per-carrier accounts in the first place. If the subsidiaries genuinely share one process and one key custody, one account is defensible, and the onboarding record should say so.

  • One shared account with a strong key is as safe as per-carrier accounts.
  • A Match block on the staff server is equivalent to a dedicated drop host.
  • Per-carrier chroots are unnecessary if folder permissions are set carefully.
  • Transfer logs from sshd alone show which carrier sent which file.
  • A dedicated host removes the need for DisableForwarding and restrict.