Skip to content

Conversation

@rfay
Copy link

@rfay rfay commented Jan 28, 2026

The CLI was failing when users didn't have a ~/.ssh/known_hosts file. Now creates both the .ssh directory (0700) and known_hosts file (0600) with proper permissions if they don't exist. It's not really valid to assume that it already exists (and it doesn't in a test environment like DDEV's automated tests)

It used to fail on lagoon ssh for example:

$ lagoon ssh -p amazeeio-ddev -e pull
Error: couldn't refresh token: couldn't get ~/.ssh/known_hosts: couldn't get ~/.ssh/known_hosts: open /home/rfay/.ssh/known_hosts: no such file or directory
Usage:
  lagoon ssh [flags]

This also fixes the odd output

[INFO]  2026/01/27 22:02:31 Running the following prerequisite command /usr/local/bin/lagoon-sync config || true
[WARN]  2026/01/27 22:02:31 ssh: no key found &{0xc000078120}
[WARN]  2026/01/27 22:02:40 'lagoon-sync' is not available on pull

I think lagoon-sync config just failed because known_hosts wasn't there, leading the logic to conclude that there was no lagoon-sync.

This was discovered exploring the problems in

  • Affected Issues have been mentioned in the Closing issues section
  • Documentation has been written/updated
  • PR title is ready for inclusion in changelog

The CLI was failing when users didn't have a ~/.ssh/known_hosts file.
Now creates both the .ssh directory (0700) and known_hosts file (0600)
with proper permissions if they don't exist.

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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