Skip to content

fix: skip missing authorized_keys cleanup paths#718

Open
nanookclaw wants to merge 1 commit into
aws:mainfrom
nanookclaw:fix/cleanup-missing-authorized-keys
Open

fix: skip missing authorized_keys cleanup paths#718
nanookclaw wants to merge 1 commit into
aws:mainfrom
nanookclaw:fix/cleanup-missing-authorized-keys

Conversation

@nanookclaw

Copy link
Copy Markdown

Closes #709.

This updates the per-user authorized_keys cleanup so the find command starts at the user home directory and filters to .ssh/authorized_keys, instead of using the file itself as the find starting path. When a user does not have that file, find now exits successfully with no matches instead of failing the whole cleanup script under set -e.

The follow-up verification loop is unchanged, so the script still fails if an authorized_keys file remains after cleanup.

Testing:

  • bash -n scripts/cleanup.sh
  • git diff --check
  • temporary find smoke check with set -e for both missing and present .ssh/authorized_keys

@nanookclaw nanookclaw requested a review from a team as a code owner June 17, 2026 22:06
@nanookclaw nanookclaw force-pushed the fix/cleanup-missing-authorized-keys branch from fb98c06 to e0077b9 Compare June 20, 2026 21:04
@nanookclaw

Copy link
Copy Markdown
Author

Rebased fix/cleanup-missing-authorized-keys onto current main and force-pushed head e0077b9.

Verification after the rebase:

  • bash -n scripts/cleanup.sh
  • git diff --check origin/main...HEAD
  • smoke check for the updated find /home/<user> -maxdepth 2 -path .../.ssh/authorized_keys behavior with both missing and present authorized_keys

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.

Make cleanup.sh robust to missing user .ssh/authorized_keys files

1 participant