Skip to content

fix: copy SSH keys off bind mounts on all platforms - #495

Merged
AaronFeledy merged 4 commits into
mainfrom
fix/load-keys-darwin-copy
Aug 19, 2026
Merged

fix: copy SSH keys off bind mounts on all platforms#495
AaronFeledy merged 4 commits into
mainfrom
fix/load-keys-darwin-copy

Conversation

@AaronFeledy

@AaronFeledy AaronFeledy commented Aug 19, 2026

Copy link
Copy Markdown
Member

What Problem This Solves

Docker bind-mounted SSH keys often show up as root-owned (especially Docker Desktop Mac with virtiofs). load-keys.sh then either cannot chmod them or skips them, so git/SSH inside the container has no IdentityFile.

Why This Change Was Made

Windows already copied keys to /lando_keys because bind mounts cannot be chmod'd. That is the correct model on every OS: copy off the mount, chown the copy, never SSH with the live bind mount.

User Impact

Mac lando init --source pantheon and other SSH-using commands can use the Lando key without switching Docker file sharing. Linux/Windows behavior matches: keys are copied, then loaded.

Evidence

  • User repro: container hash matched host, file owned by root
  • Windows already used /lando_keys for this reason
  • Keys example checks now grep /lando_keys/

Note

Medium Risk
Changes core container SSH key loading for every OS; mis-copy or permission bugs would break git/SSH in apps, but scope is limited to load-keys.sh.

Overview
SSH keys are always staged in /lando_keys before use, extending the Windows-only workaround to every host OS so bind-mounted keys (often root-owned on Docker Desktop Mac) can be chown/chmod and registered as IdentityFile in ssh_config.

load-keys.sh now wipes and repopulates /lando_keys from /lando/keys, /var/www/.ssh, and optionally /user/.ssh, then scans only that directory. Key discovery no longer filters by -user $LANDO_WEBROOT_USER, and explicit LANDO_LOAD_KEYS names are copied from /user/.ssh into /lando_keys instead of referencing the mount directly. The keys example README and CHANGELOG document the new paths.

Reviewed by Cursor Bugbot for commit 7177701. Bugbot is set up for automated code reviews on this repo. Configure here.

Docker Desktop Mac presents ~/.lando/keys as root, so load-keys.sh
skips them with -user www-data. Copy off the mount and chown like Windows.
@netlify

netlify Bot commented Aug 19, 2026

Copy link
Copy Markdown

Deploy Preview for lando-core ready!

Name Link
🔨 Latest commit 7177701
🔍 Latest deploy log https://app.netlify.com/projects/lando-core/deploys/6a8626cc8f70c8000878d2ac
😎 Deploy Preview https://deploy-preview-495--lando-core.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 72 (🔴 down 21 from production)
Accessibility: 89 (no change from production)
Best Practices: 92 (no change from production)
SEO: 90 (no change from production)
PWA: -
View the detailed breakdown and full score reports
🤖 Make changes Run an agent on this branch

To edit notification comments on pull requests, go to your Netlify project configuration.

Drop the www-data find filter. If chown/chmod on the mount still leaves
the key unreadable, copy just that file to /lando_keys.
@AaronFeledy AaronFeledy changed the title fix: copy bind-mounted SSH keys on Darwin before loading fix: load bind-mounted SSH keys even when owned by root Aug 19, 2026
Use /lando_keys everywhere, same as Windows. Docker bind mounts cannot
be chowned reliably, so IdentityFile always points at the in-container copy.
@AaronFeledy AaronFeledy changed the title fix: load bind-mounted SSH keys even when owned by root fix: copy SSH keys off bind mounts on all platforms Aug 19, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 6c8818d. Configure here.

Comment thread scripts/load-keys.sh
Stale copies survived restarts and stayed in ssh_config after host keys
were removed or deselected.
@AaronFeledy
AaronFeledy merged commit 518c02b into main Aug 19, 2026
76 checks passed
@AaronFeledy
AaronFeledy deleted the fix/load-keys-darwin-copy branch August 19, 2026 22:45
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.

1 participant