SSH Keys Don’t Expire. NIS2 Deadlines Do.
NIS2 allows 24 hours for the early warning, 72 hours for an assessment and one month for the root cause. A static SSH key can’t answer what those reports ask: whose it is, where else it works and when it stops working. Key hygiene comes first. Certificates then put the answers into every login, and time-limited, approved access records who agreed to it.
Key takeaways
- A static SSH key has no owner field, no end date and no central record, so it can’t answer what a NIS2 incident report asks.
- Key hygiene lowers the risk. SSH certificates put a name, a validity period and a serial number into every login.
- On sensitive servers, a time window and a second person’s approval record who agreed.
Related: Cyber insurance: lack of evidence puts the policy at risk · Google Spent Years Building Zero Trust Foundations
One line, three questions
Log in to any production Linux server, open an authorized_keys file and pick a line. Whose key is it? Which other servers accept it? When does it stop working?
In my experience the honest answers are: probably the person named in the comment, nobody knows, and never.
A NIS2 incident report asks much the same. In Germany, section 32 of the BSI Act has since December 2025 required an early warning within 24 hours of learning of a significant incident. Within 72 hours comes a notification with a first assessment of severity and impact. A month after that, the final report has to name the probable root cause and the remedies. Austria’s NISG 2026 has applied the same three deadlines since 1 October 2026. Switzerland, outside NIS2, has obliged operators of critical infrastructure to report cyberattacks within 24 hours since April 2025.
Early warning after becoming aware of a significant incident (section 32 BSI Act)
Notification with a first assessment of severity and impact
Final report with probable root cause and remedies
Every stage comes down to identity. Whose access was it, how far does it reach, since when, and has it been closed?
Why a key can’t answer
A public key is one line of text in a file on each server that accepts it. The format has no field for an owner. The comment at the end is free text that anyone with write access can change. There is no end date unless somebody adds one: OpenSSH has offered expiry-time since 2018, and I rarely find it set. And there is no register. The directory doesn’t know the key exists, so neither does the access review, nor the report your management signs off.
In a mid-sized company the keys usually belong to no team. They fall between the Linux team and the directory team, external providers’ keys included.
The log is only a little better. For a key login, sshd records the account and a fingerprint:
If five people hold a key for deploy, that fingerprint is all that separates them, and only if someone kept the list.
The private half is out of your hands entirely. It can be copied, and no server can tell whether it’s protected by a passphrase. A private key stored on one server is a credential for every other server that trusts it. ESET reported in 2024 that the Ebury malware had compromised about 400,000 servers since 2009, its operators reusing the keys and passwords found on each to reach the next. Intruders leave keys behind as well: a joint advisory of August 2025, co-signed by Germany’s BSI, warns that state-sponsored actors may add keys to existing SSH services on network devices to get back in.
Then there are leavers. Disabling a person in the directory removes none of their keys from shared or service accounts. Locking a local account’s password usually doesn’t stop a key login either, as the passwd manual page itself warns.
So at hour 24 you can’t say how far this could spread. At hour 72 the impact assessment means reading every key file on every server. And a month on, you can’t show that every copy is gone.
Hygiene first
NIST wrote in 2015 that many organisations didn’t know how many SSH keys they had or who held copies. In my experience that still holds. None of what follows needs a product:
Checklist · key hygiene
- ✓Inventory every key for every account on every server, root and service accounts included, with fingerprint, owner and options.
- ✓Disable what nobody claims. Comment it out, wait, then delete.
- ✓Take key files out of users' hands. With AuthorizedKeysFile /etc/ssh/authorized_keys/%u they live in a root-owned path, and nobody can grant themselves access.
- ✓Fence in automation keys with restrict, from= and expiry-time=.
- ✓Get private keys off servers. The BSI's TR-02102-4 asks that private keys be protected against copying. For people that means FIDO2-backed keys, whose private half never leaves the hardware.
- ✓Collect sshd logs centrally, fingerprints included.
- ✓Repair the leaver process. Expire the account, don't just lock it, and remove the person's keys from shared accounts.
That’s the minimum, and it’s work without an end. The format has no owner and no end date, so you supply both by hand for as long as keys exist.
Why certificates
A certificate turns the arrangement round. The server stops trusting individual keys and trusts a certificate authority instead, in one line of sshd configuration (TrustedUserCAKeys). A person signs in to the identity provider with multi-factor authentication and receives a certificate valid for a few hours. It carries what the key lacks: an identity set by the CA, the accounts it may be used for, a validity period and a serial number.
None of it is new: OpenSSH has supported certificates since version 5.4 in March 2010.
Three things change. The log names the person, even on a shared account you haven’t retired yet, because sshd records the certificate’s identity and serial number:
Access ends without anyone doing anything. And a leaver gets no further certificate; the last one runs out the same day, with nothing to clean up on any server.
| Property | Static key | SSH certificate |
|---|---|---|
| Owner | no field, only a freely editable comment | identity set by the CA |
| End date | only with expiry-time, rarely set | valid for a few hours |
| Log entry | account and fingerprint | person and serial number |
| Leavers | keys stay in shared accounts | no new certificate, the last one expires |
The limits:
- The benefit is the short lifetime rather than the format. A certificate signed without a validity period is valid indefinitely.
- Expiry stops new logins. A session already open carries on.
- The CA’s signing key becomes the most valuable secret you own. It belongs in an HSM or a key service, with every signature logged.
- Old keys work until you switch them off with
AuthorizedKeysFile none. Until then you’ve added a way in, not replaced one. - Automation needs a way to renew. Appliances that can’t use certificates stay on keys as listed exceptions with an end date.
- Keep one break-glass path that works when the CA or the identity provider doesn’t.
Time-limited, approval-gated access in practice
A short-lived certificate settles how long a login lasts. It doesn’t settle whether this person should be on this server today: anyone entitled can collect a fresh one every morning. For your most sensitive servers, make the entitlement temporary too. Nobody holds standing access. A person requests a window, a second person approves it, and the server ends it.
Here is how that works in LinuxGuard, the platform my company builds. An administrator switches on timed access and approval for a group of servers, say the production databases. Anna needs one of them for a schema change. In the access portal she picks the server and a window of 30 minutes, one, four or eight hours. The request goes to a second person, never Anna herself, who approves it after a fresh identity check. Undecided, it lapses after an hour. The portal shows the access as ready only once the server itself confirms it. Where certificates are switched on, Anna’s certificate ends with the window. When the window closes, the server removes the access and locks the account itself, even if it can’t reach the central service. An open session can hold the window for eight more hours at most. Request, approval and window go into one central record.
A 30-day window is standing access with a calendar reminder.
Whatever you use, cap windows in hours: a 30-day window is standing access with a calendar reminder. And keep approval for the servers where a mistake costs most, because people asked to approve everything approve anything.
What it means for NIS2, and for the others
Article 21 of NIS2 lists ten areas of risk management, which section 30 of the BSI Act transposes. Keys touch three: the use of cryptography, access control and multi-factor authentication (MFA). With certificates the key lifecycle is part of the credential, every login maps to one person, and MFA is enforced and recorded where the certificate is issued, instead of resting on a passphrase nobody can verify.
The larger effect is on reporting. At hour 24 the CA’s records show who held a valid certificate, and anything stolen expires within hours, so the question of spread has a bounded answer. At hour 72 the server logs name people, and the impact assessment is a query rather than a search. Where access needed approval, the record also names who gave it. In the final report the remedies section gets shorter, because there are no keys to hunt down.
Management gets something as well. Section 38 of the BSI Act makes it responsible for implementing and overseeing the measures. Its report can now carry two numbers: the longest lifetime of any admin credential, in hours, and the number of static keys left.
The same evidence serves other regimes. For cloud, data centre and managed service providers, among others, the NIS2 implementing regulation is explicit: user identities linked to a single person, access authorised by the relevant persons, third-party access limited in scope and duration, and keys with activation and deactivation dates. The DORA technical standards want financial entities to limit generic and shared accounts, keep users identifiable at all times, grant privileged access on a need-to-use or ad-hoc basis and withdraw access without undue delay when employment ends. ISO/IEC 27001:2022 covers the same ground in its Annex A controls. The wording differs. What they want to see doesn’t: a name, an approval, an end date and a record.
One caution. No regulation prescribes SSH certificates, and none is met by them alone. What changes is where the evidence comes from: each login produces it.
Where to start
Begin with the people who log in to production. Run certificates alongside keys for one group of servers, and switch the key files off for that group once certificate logins are proven. Automation follows, then the listed exceptions. And report one figure to management every month until it’s zero or a short, justified list: static keys remaining.
My bet is that within a few years a static key will be the exception you have to justify in an audit.
Then go back to the server from the beginning. With certificates there’s no line to pick. Whose access, how far and until when are in the log before anyone asks.
Frequently asked questions
Each question is locked. Tap to unlock the answer.
What reporting deadlines apply under NIS2 in Germany?
Section 32 of the BSI Act requires an early warning within 24 hours of becoming aware of a significant incident, a notification with a first assessment within 72 hours and a final report on root cause and remedies one month later.
How does an SSH certificate differ from a static SSH key?
The certificate carries an identity set by the certificate authority, the accounts it may be used for, a validity period and a serial number. A static key has no owner field and stays valid indefinitely unless someone adds an end date.
Does NIS2 require SSH certificates?
No regulation prescribes SSH certificates. They provide evidence for three areas of Article 21 of NIS2 and section 30 of the BSI Act: cryptography, access control and multi-factor authentication.
Since when has OpenSSH supported certificates?
Since version 5.4 in March 2010. The expiry-time option for individual keys has existed since 2018.
Image source: AI-generated (November 2026). Portrait: LinuxGuard
Editor’s Picks
Editor’s PickGoogle Spent Years Building Zero Trust FoundationsEditor’s PickA CISO does not take responsibility away from company leadershipEditor’s PickBlack October: Many attacks had been running for months
More from the MBF Media Network
Digital ChiefsQuantum computers will later read what attackers store todaycloudmagazinAWS SSM Agent lets attackers quietly become rootMyBusinessFutureManufacturers Report CRA Incidents to ENISA Ahead of the CSIRT






