Skip to content

feat(ssh): agent timeout for passphrase-protected keys - #68

Merged
ulises-c merged 2 commits into
mainfrom
feat/ssh-keygen-agent-timeout
Jul 30, 2026
Merged

ulises-c merged 2 commits into
mainfrom
feat/ssh-keygen-agent-timeout

Conversation

@ulises-c

Copy link
Copy Markdown
Owner

Summary

  • SSH key gen: agent timeout for passphrase-protected keys. When a passphrase is set, create_ssh_key.sh now prompts for how long ssh-agent keeps the key unlocked — minutes, default 15, 0 = never cache (passphrase asked on every use). The key is added with ssh-add -t Nm, and the generated Host block writes a matching AddKeysToAgent Nm (or no for 0) so keys re-added on first use expire too instead of staying unlocked forever. Keys without a passphrase behave exactly as before. Pre-fillable via AGENT_TIMEOUT=N; README updated.
  • Railguard: allow lowercase ~/bitbucket dev root. The fence matches path strings literally and Linux is case-sensitive, so the existing ~/Bitbucket entry never covered the actual lowercase checkouts. denied_paths still takes precedence.

Carried over from the merged feat/linux-benchmarking branch's working tree. A local driftcheck.sh edit was dropped as already merged in improved form (cf23033).

Testing

  • shellcheck --severity=warning and bash -n clean.
  • Live-tested ssh-add -t 15m / -t 1m against a real passphrase-protected ed25519 key (lifetimes 900s/60s confirmed).
  • /security-review pass: no findings — AGENT_TIMEOUT is validated digits-only before reaching ssh-add/ssh_config, and every branch is at least as tight as the old no-lifetime ssh-add.

🤖 Generated with Claude Code

ulises-c and others added 2 commits July 30, 2026 13:35
The fence matches path strings literally and Linux is case-sensitive, so
"~/Bitbucket" never covered the actual ~/bitbucket checkouts.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
When a passphrase is set, prompt for how long ssh-agent keeps the key
unlocked (minutes, default 15; 0 = never cache, ask on every use). The
generated Host block gets a matching AddKeysToAgent interval so keys
re-added on first use expire too, instead of staying unlocked forever.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@ulises-c
ulises-c merged commit 5768547 into main Jul 30, 2026
7 checks passed
@ulises-c
ulises-c deleted the feat/ssh-keygen-agent-timeout branch July 30, 2026 21:29
@ulises-c ulises-c linked an issue Jul 30, 2026 that may be closed by this pull request
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add time gated SSH key script

1 participant