[{"data":1,"prerenderedAt":208},["ShallowReactive",2],{"seo-verification":3,"blog-ssh-keys-off-disk-short-lived-certificates-vps-ma-en":6,"promo-bar-likely":156},{"google":4,"bing":5},"EycwPY2XMyTkVzas3n1ygeNJFGAH513qrMjfDljzsMQ","",{"key":7,"data":8},"blog-ssh-keys-off-disk-short-lived-certificates-vps-ma-en",{"id":9,"slug":10,"slugs":11,"title":15,"excerpt":16,"readTime":17,"views":18,"isPinned":19,"noindex":19,"publishedAt":20,"updatedAt":21,"category":22,"categories":28,"featuredImage":30,"bgImage":31,"posterImage":32,"relatedSolution":33,"intro":36,"keyPoints":37,"sections":38,"ctaTitle":141,"ctaBody":142,"ctaButton":143,"ctaUrl":144,"relatedPosts":145},594,"ssh-keys-off-disk-short-lived-certificates-vps",{"fr":12,"en":10,"ar":13,"es":14},"ssh-cles-hors-du-disque-certificats-courte-duree-vps","مفاتيح-ssh-خارج-القرص-شهادات-قصيرة-المدة-vps","claves-ssh-fuera-del-disco-certificados-corta-duracion-vps","SSH keys off the disk: short-lived certificates for VPS","Where to keep SSH keys when a coding agent runs under your account: encrypted key, FIDO2 ed25519-sk, CA-signed certificates, with an end-to-end test.",10,0,false,"2026-11-25T00:00:00+00:00","2026-11-26T00:49:56+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},8,"Security & Monitoring","securite-monitoring","bg-rose-500\u002F10 text-rose-400","security",[29],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fssh-cles-hors-du-disque-certificats-courte-duree-vps-cover.webp","\u002Fblog\u002Fcovers\u002Fbg.svg","\u002Fblog\u002Fcovers\u002Fssh-cles-hors-du-disque-certificats-courte-duree-vps-poster.svg",{"categorySlug":34,"appSlug":35},"cybersecurity-bastion","bastion-host","When a coding agent runs under your account, `~\u002F.ssh` is within its reach: any private key without a passphrase is readable there, by the agent and by every script it launches. This guide offers three tiers to adopt one at a time: an encrypted key with `ssh-agent`, a FIDO2 hardware key, then short-lived SSH certificates signed by a certificate authority. You will see what each one stops, what it lets through, and how a collaborator leaving no longer forces you to touch client servers.",[],[39,43,53,56,59,62,82,85,94,125,134,137],{"type":40,"title":41,"body":42},"h2","Why a key on disk is no longer enough","A coding agent started from your session inherits your rights: it reads your home directory, your environment variables and the socket of your SSH agent. A private key without a passphrase in `~\u002F.ssh` then has no protection of its own. A script it runs, a booby-trapped dependency or an instruction slipped into a repository is enough to copy it, as the guide on \u003Ca href=\"\u002Fen\u002Fblog\u002Fisolate-ai-coding-agents-on-a-vps-agents-md-injection\">isolating coding agents\u003C\u002Fa> describes. A recent Hacker News thread titled \"Don't keep your SSH keys on disk\" shows the topic is being debated; we take only that signal from it, none of its statements. For an agency, a second trigger comes on top: a collaborator leaving. Their key sits in `authorized_keys` on every client VPS, and you have to go through them one by one. The three tiers below answer both problems, and you can stop at the one that is enough for your team.",{"type":44,"title":45,"items":46},"ul","What is within a coding agent's reach",[47,48,49,50,51,52],"**The `~\u002F.ssh` folder** — a private key without a passphrase is a file like any other; copying it takes one command line.","**The SSH agent socket** — the `SSH_AUTH_SOCK` variable points to a socket your account can open, so the coding agent can too: it requests signatures without ever reading the key.","**The scripts and dependencies it launches** — they run with your rights, not with its own.","**Your SSH configuration** — `~\u002F.ssh\u002Fconfig` and `known_hosts` list your client servers, that is, the targets.","**Workstation backups** — an unencrypted key leaves with every backup copy.","**Permanent access** — a key published on a server stays valid until someone removes it, whether anyone leaves or not.",{"type":40,"title":54,"body":55},"Tier 1: encrypted key, ssh-agent and confirmation on every use","Start by encrypting the key: `ssh-keygen -t ed25519 -a 100 -f ~\u002F.ssh\u002Fid_agence`, with a real passphrase. The `-a` option sets the number of key derivation rounds, 32 by default according to the manual page. Then load the key with `ssh-add -c ~\u002F.ssh\u002Fid_agence`: the `-c` option subjects each use to a confirmation, performed by `ssh-askpass`. `AddKeysToAgent confirm` in `~\u002F.ssh\u002Fconfig` has the same effect each time a key is added, and `ssh-add -t 4h` limits how long the key stays in the agent. This tier costs nothing and blocks copying the file at rest. It does not protect against a confirmation click given out of habit: the limit is detailed below. Load the key at the start of the day rather than leaving it in the agent permanently.",{"type":40,"title":57,"body":58},"Tier 2: FIDO2 hardware key with ed25519-sk","An `ed25519-sk` key keeps the secret inside a FIDO2 security key; the file on disk is only a handle. With `ssh-keygen -t ed25519-sk -O resident -O verify-required -O application=ssh:agence -f ~\u002F.ssh\u002Fid_agence_sk`, each signature requires a touch on the key, and `verify-required` adds user verification, in practice the PIN. `resident` stores the handle on the key itself, and `ssh-keygen -K` downloads it on another workstation. The application string must begin with `ssh:`. Avoid `no-touch-required`, which removes the presence gesture altogether. On the server side, `PubkeyAuthOptions verify-required` in `sshd_config` refuses signatures without verification. Without the key plugged in and touched, nothing signs, even if the file is copied. Buy two keys from the start: the second one will be your backup.",{"type":40,"title":60,"body":61},"Tier 3: SSH certificates signed by a CA","A certificate is your public key signed by a certificate authority (CA) the server knows. The server no longer keeps a list of keys: it checks the signature, the validity period and the allowed names. You sign with `ssh-keygen -s ca_agence -I alice-portable -n agence-ops -V +8h id_agence.pub`. The `-I` option sets the identifier that will appear in logs and can be used to revoke, `-n` lists the principals, `-V` sets the validity, here eight hours. The result is an `id_agence-cert.pub` file. On the server, `TrustedUserCAKeys` points to the CA public key, `AuthorizedPrincipalsFile` says which principals open which account, and `RevokedKeys` points to a list of keys or a KRL for emergencies. Without `AuthorizedPrincipalsFile`, the account name must appear in the certificate's principals. A certificate without a principal is refused.",{"type":63,"title":64,"headers":65,"rows":69},"comparison","The three tiers side by side",[66,67,68],"Tier","What it stops","What it lets through",[70,74,78],[71,72,73],"1. Encrypted key and `ssh-add -c`","Copying the key file, and silent use of the agent if you read every request","A confirmation approved out of reflex; a key that stays permanent on the servers",[75,76,77],"2. `ed25519-sk` key with `verify-required`","Any signature without your presence and PIN; a useful copy of the key","A security key lost without a backup key; a key that stays permanent on the servers",[79,80,81],"3. Certificate signed by a CA","Access forgotten after a departure: short validity, no `authorized_keys` to clean up","A stolen CA key; a signature obtained by an agent that reaches the CA",{"type":40,"title":83,"body":84},"What this changes for an agency","Without certificates, a collaborator leaving means removing their key from every client VPS, and a missed one stays open without anyone noticing. With a CA, you configure each server once: `TrustedUserCAKeys` and the principals file. After that, each collaborator receives an eight-hour certificate at the start of the day. When they leave, you stop signing, and their last certificate expires on its own: client servers receive no change. One principal per client, for example `client-acme`, also limits what each certificate opens. If the departure is urgent, add the certificate to the `RevokedKeys` list: that is the exception, not the routine. For the first connection to a new VPS, reread \u003Ca href=\"\u002Fen\u002Fblog\u002Ffirst-ssh-login-vps\">the first SSH login\u003C\u002Fa>; for the shared entry point where this configuration belongs, see \u003Ca href=\"\u002Fen\u002Fblog\u002Fbastion-host-on-vps-securing-your-ssh-access\">the bastion guide\u003C\u002Fa>.",{"type":44,"title":86,"items":87},"Keeping the CA without locking yourself out",[88,89,90,91,92,93],"**Offline CA key** — store it on an unplugged encrypted medium, or in a PKCS#11 token: `ssh-keygen -s` accepts `-D` for a token and `-U` for a key held by an agent. Never on the workstation where the coding agent runs.","**A second, backup CA** — generate two CAs, list both public keys in the `TrustedUserCAKeys` file, and keep the second one sealed and offline. Losing the first does not cut access.","**A planned rotation** — add the new public key to the file, sign with it, then remove the old one once the last certificates have expired. With eight hours of validity, the transition fits in a day.","**A tested emergency route** — keep access through your provider's console or a dedicated emergency key, tried before you need it.","**Short validity** — `-V +8h` makes revocation almost unnecessary: a stolen certificate is worth only a few hours.","**Accurate clocks** — validity is judged on the server's time and the workstation's; enable NTP synchronization everywhere.",{"type":95,"title":96,"steps":97},"steps","End-to-end test: certificate accepted, then refused",[98,101,104,107,110,113,116,119,122],{"title":99,"body":100},"Generate the CA, off the workstation","On a clean machine, ideally offline: `ssh-keygen -t ed25519 -f ca_agence -C \"ca-agence\"`, with a passphrase. `ca_agence` stays secret; only `ca_agence.pub` leaves the machine. For this test, a throwaway CA is enough.",{"title":102,"body":103},"Prepare the collaborator's key","On their workstation: `ssh-keygen -t ed25519 -a 100 -f ~\u002F.ssh\u002Fid_agence -C \"alice@agence\"`. Only `id_agence.pub` is handed to the CA. With an `ed25519-sk` key, you sign its public part the same way.",{"title":105,"body":106},"Trust the CA on the VPS","Copy `ca_agence.pub` to `\u002Fetc\u002Fssh\u002Fca_agence.pub`. In `\u002Fetc\u002Fssh\u002Fsshd_config`, add `TrustedUserCAKeys \u002Fetc\u002Fssh\u002Fca_agence.pub` and `AuthorizedPrincipalsFile \u002Fetc\u002Fssh\u002Fauth_principals\u002F%u`. Create `\u002Fetc\u002Fssh\u002Fauth_principals\u002Fdeploy` with the single line `agence-ops`. Here, `%u` becomes the name of the account being opened.",{"title":108,"body":109},"Validate before reloading","`sudo sshd -t` checks the syntax, then `sudo systemctl reload ssh` reloads the service, which is called `sshd` on AlmaLinux and Rocky. Keep your session open during the whole test: if something is wrong, you can roll back.",{"title":111,"body":112},"Sign a two-minute certificate","`ssh-keygen -s ca_agence -I alice-portable -n agence-ops -V +2m ~\u002F.ssh\u002Fid_agence.pub` creates `~\u002F.ssh\u002Fid_agence-cert.pub`. In production, replace `+2m` with `+8h`.",{"title":114,"body":115},"Reread the certificate","`ssh-keygen -L -f ~\u002F.ssh\u002Fid_agence-cert.pub` shows the identifier (`Key ID`), the principals and the `Valid` line, which gives the validity bounds. Check that the principal is `agence-ops`.",{"title":117,"body":118},"Connect with the certificate","`ssh -v -i ~\u002F.ssh\u002Fid_agence -o CertificateFile=~\u002F.ssh\u002Fid_agence-cert.pub -o IdentitiesOnly=yes deploy@your-domain.com`. The connection opens; the `-v` output shows an `ED25519-CERT` identity being offered, and the server log (`journalctl -u ssh`, with `LogLevel VERBOSE`) contains `Accepted certificate ID \"alice-portable\"`.",{"title":120,"body":121},"Wait for expiry, then retry","Wait more than two minutes and rerun the same command. The client answers `Permission denied (publickey)`, and the server log contains the line `Certificate invalid: expired`. No server file changed between the two attempts.",{"title":123,"body":124},"Sign the working certificate","Sign again with `-V +8h` for real use: access returns with no action on the VPS. That is the routine for a working day.",{"type":44,"title":126,"items":127},"Troubleshooting: the messages you will actually see",[128,129,130,131,132,133],"**`Permission denied (publickey)`** — the client does not say why. Rerun with `ssh -v` to see the identities offered, then read the server log (`journalctl -u ssh`, with `LogLevel VERBOSE`): the cause is written there.","**`sign_and_send_pubkey: signing failed for ED25519 \"…\" from agent: agent refused operation`** — the agent refused to sign. You declined the `ssh-add -c` confirmation, or no prompt could appear for lack of `ssh-askpass`: install a confirmation program, then reload the key.","**`Certificate invalid: expired`** — the certificate is past the `Valid` bound that `ssh-keygen -L` displays: sign a new one. A `Certificate invalid: not yet valid` points instead to a skewed clock; `-V -5m:+8h` leaves a margin.","**`Certificate does not contain an authorized principal`** — none of the certificate's principals appears in `\u002Fetc\u002Fssh\u002Fauth_principals\u002F\u003Caccount>`. Reread the `-n` option with `ssh-keygen -L`; a certificate signed without `-n` is refused outright.","**Everyone is refused after adding `RevokedKeys`** — the manual page says it: if the file is not readable, public key authentication is refused for all users. Check the path and permissions before reloading.","**The certificate is never offered** — with `IdentitiesOnly yes`, `ssh` sends only the configured identities: declare `IdentityFile` and `CertificateFile` together, or pass them with `-i` and `-o`.",{"type":40,"title":135,"body":136},"The honest limit: what these tiers do not stop","Encrypting the key and going through `ssh-agent` is not enough. A coding agent running under your account can open the socket named by `SSH_AUTH_SOCK` and request signatures as long as the key is loaded there: it does not need to read it. Only a gesture toward you blocks this silent use: the `ssh-add -c` confirmation, or the touch on the FIDO2 key. That gesture only counts if you read it; approved out of reflex, it no longer protects. A short-lived certificate limits the damage in time, it does not forbid use while it is valid. To go further, separate the roles: the coding agent on another machine or another server, as the guide on \u003Ca href=\"\u002Fen\u002Fblog\u002Fisolate-ai-coding-agents-on-a-vps-agents-md-injection\">isolating agents\u003C\u002Fa> explains.",{"type":138,"title":139,"body":140},"tip","Where to check each option","The options cited can be checked in the OpenSSH manual pages:\n\u003Ca href=\"https:\u002F\u002Fman.openbsd.org\u002Fssh-keygen\">ssh-keygen\u003C\u002Fa> · \u003Ca href=\"https:\u002F\u002Fman.openbsd.org\u002Fssh-add\">ssh-add\u003C\u002Fa>\n\u003Ca href=\"https:\u002F\u002Fman.openbsd.org\u002Fsshd_config\">sshd_config\u003C\u002Fa> · \u003Ca href=\"https:\u002F\u002Fman.openbsd.org\u002Fssh_config\">ssh_config\u003C\u002Fa>","A root VPS to host your bastion and your CA","ServOrbit.com VPS give you root access and a choice of system: you configure sshd as this guide describes. For an agency, the Bastion Host template in the Marketplace provides the entry point where the CA belongs. You keep the client relationship; we run the infrastructure.","See the agency offer","\u002Fsolutions\u002Fagences",[146,169,187],{"id":147,"slug":148,"slugs":149,"title":153,"excerpt":154,"readTime":155,"views":155,"isPinned":19,"noindex":156,"publishedAt":157,"updatedAt":158,"category":159,"categories":164,"featuredImage":166,"bgImage":31,"posterImage":167,"relatedSolution":168},452,"first-ssh-login-vps",{"fr":150,"en":148,"ar":151,"es":152},"premier-acces-ssh-vps","أول-اتصال-ssh-بخادم-vps","primer-acceso-ssh-vps","Log in to your VPS over SSH for the first time","Retrieve your VPS root password with the one-time link received by email, then log in to your server over SSH for the first time.",2,true,"2026-10-16T00:00:00+00:00","2026-10-16T01:57:35+00:00",{"id":160,"name":161,"slug":162,"color":163,"icon":162},12,"Guides","guides","bg-emerald-500\u002F10 text-emerald-400",[165],{"id":160,"name":161,"slug":162,"color":163,"icon":162},"\u002Fblog\u002Fcovers\u002Fpremier-acces-ssh-vps-cover.webp","\u002Fblog\u002Fcovers\u002Fpremier-acces-ssh-vps-poster.svg",null,{"id":170,"slug":171,"slugs":172,"title":176,"excerpt":177,"readTime":178,"views":155,"isPinned":19,"noindex":19,"publishedAt":179,"updatedAt":180,"category":181,"categories":182,"featuredImage":184,"bgImage":31,"posterImage":185,"relatedSolution":186},158,"bastion-host-on-vps-securing-your-ssh-access",{"fr":173,"en":171,"ar":174,"es":175},"heberger-bastion-host-vps","مضيف-bastion-على-خادم-vps-تأمين-وصولك-عبر-ssh","bastion-host-en-vps-accesos-ssh","Bastion Host on VPS: securing your SSH access","Deploy a Bastion Host on a ServOrbit VPS: a hardened SSH entry point, centralized access, logs and security rules.",3,"2026-07-05T00:00:00+00:00","2026-09-07T11:26:10+00:00",{"id":23,"name":24,"slug":25,"color":26,"icon":27},[183],{"id":23,"name":24,"slug":25,"color":26,"icon":27},"\u002Fblog\u002Fcovers\u002Fheberger-bastion-host-vps-cover.webp","\u002Fblog\u002Fcovers\u002Fheberger-bastion-host-vps-poster.svg",{"categorySlug":27,"appSlug":35},{"id":188,"slug":189,"slugs":190,"title":194,"excerpt":195,"readTime":160,"views":196,"isPinned":19,"noindex":156,"publishedAt":197,"updatedAt":198,"category":199,"categories":204,"featuredImage":206,"bgImage":31,"posterImage":207,"relatedSolution":168},522,"isolate-ai-coding-agents-on-a-vps-agents-md-injection",{"fr":191,"en":189,"ar":192,"es":193},"agents-de-code-ia-vps-agents-md-injection-isoler","عزل-وكلاء-البرمجة-بالذكاء-الاصطناعي-على-vps-agents-md","aislar-agentes-de-codigo-ia-en-un-vps-agents-md-inyeccion","Isolate AI Coding Agents on a VPS: Booby-Trapped AGENTS.md","A booby-trapped AGENTS.md or CLAUDE.md can steer your coding agent. Unprivileged user, filtered egress, no production secrets: the commands.",1,"2026-10-28T00:00:00+00:00","2026-10-29T03:10:22+00:00",{"id":196,"name":200,"slug":201,"color":202,"icon":203},"Artificial Intelligence","intelligence-artificielle","bg-purple-500\u002F10 text-purple-400","ia",[205],{"id":196,"name":200,"slug":201,"color":202,"icon":203},"\u002Fblog\u002Fcovers\u002Fagents-de-code-ia-vps-agents-md-injection-isoler-cover.webp","\u002Fblog\u002Fcovers\u002Fagents-de-code-ia-vps-agents-md-injection-isoler-poster.svg",1795742922510]