Skip to content

Add SSH authorized keys configuration for Home Assistant OS - #53089

Draft
agners wants to merge 1 commit into
home-assistant:devfrom
agners:os-ssh-authorized-keys
Draft

Add SSH authorized keys configuration for Home Assistant OS#53089
agners wants to merge 1 commit into
home-assistant:devfrom
agners:os-ssh-authorized-keys

Conversation

@agners

@agners agners commented Jul 11, 2026

Copy link
Copy Markdown
Member

Proposed change

Allow configuring the SSH authorized keys of the Home Assistant Operating System developer SSH service (port 22222) from the UI, so users no longer need a USB drive with a CONFIG/authorized_keys file to enable host SSH access.

  • Adds an "SSH access" entry to the board card on Settings > System > Hardware, shown only when the host reports the haos feature.
  • The entry opens a dialog with a textarea (one public key per line) that saves via a new POST /os/ssh/authorized_keys Supervisor endpoint with body {"keys": ["ssh-ed25519 AAAA…", …]}, replacing all previously configured keys.
  • Since the keys cannot be read back (os-agent only supports add/clear), the dialog starts empty, warns that saving replaces all existing keys, and asks for confirmation before saving an empty list (which deletes all keys and disables SSH access).

This PR requires Supervisor backend work before it can be merged. The os-agent already exposes AddSSHAuthKey/ClearSSHAuthKeys on the io.hass.os System D-Bus object, but the Supervisor neither wraps them in supervisor/dbus/agent/system.py nor exposes a REST endpoint. The expected contract implemented here: POST /os/ssh/authorized_keys with {"keys": [...]} clears existing keys and adds the given ones; an empty list just clears.

Screenshots

Type of change

  • Dependency upgrade
  • Bugfix (non-breaking change which fixes an issue)
  • New feature (thank you!)
  • Breaking change (fix/feature causing existing functionality to break)
  • Code quality improvements to existing code or addition of tests

Additional information

Checklist

  • I understand the code I am submitting and can explain how it works.
  • The code change is tested and works locally.
  • There is no commented out code in this PR.
  • I have followed the perfect PR recommendations
  • Any generated code has been carefully reviewed for correctness and compliance with project standards.

If user exposed functionality or configuration variables are added/changed:

To help with the load of incoming pull requests:

🤖 Generated with Claude Code

Allow configuring the SSH authorized keys of the Home Assistant
Operating System developer SSH service (port 22222) from the hardware
settings page. The entry is only shown on Home Assistant OS
installations and uses the Supervisor /os/ssh/authorized_keys endpoint.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant