Home Assistant: How to Set Up Host SSH on Port 22222

Developer access via port 22222 gives you full root access directly to the underlying Home Assistant OS (the operating system running your smart home server), rather than dropping you into an isolated container. While useful for in-depth troubleshooting or low-level system tweaks, it strictly requires an SSH key instead of a password. This guide walks you through the add-on setup and explains the crucial steps if your connection fails afterward.

Warning: This access bypasses safeguards and grants you full administrative privileges on the host system. Incorrect commands can render your entire installation unusable.

What You Need

  • A running instance of Home Assistant OS (e.g., on a Raspberry Pi)
  • An SSH key pair on your PC or Mac
  • The third-party repository by Adam Outler for the helper add-on

1. Generate an SSH Key Pair on Your Machine

For security reasons, Home Assistant does not allow password authentication on port 22222. If you don’t already have one, create an SSH key pair in your computer’s terminal:

ssh-keygen -t rsa -b 4096

Next, copy the entire content of the public key (the file ending in .pub, typically id_rsa.pub) as a single line to your clipboard.

2. Add the Repository and Install the Add-on

The easiest method without using a USB drive is via a community add-on that injects the configuration directly into the host system. If you’ve only used standard tools so far, check out how to connect to Home Assistant via SSH normally.

  1. In Home Assistant, navigate to Settings > Add-ons > Add-on Store.
  2. Click the three-dot menu in the upper right, select Repositories, and enter the following URL: https://github.com/adamoutler/HassOSConfigurator.
  3. Search for HassOS SSH port 22222 Configurator and click Install.

3. Configure the Key

According to the developer, AppArmor has been removed, so you no longer need to toggle “Disable Security”:

  1. Switch to the add-on’s Configuration tab.
  2. Paste your public key on a single line into the configuration field:
SSHKey: "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDGTlRA... your_name@machine"
  1. Save the settings, start the add-on, and check the logs in the Log tab. Once executed successfully, you can safely uninstall the add-on.

4. Reboot the Device

Even if the add-on reports success, port 22222 is often not accessible immediately. Perform a reboot of the device after running the add-on (if necessary, by briefly disconnecting the power supply).

Loading product data …

Does It Work?

Open a terminal on your computer and initiate the connection to the host:

ssh -i ~/.ssh/id_rsa [email protected] -p 22222

Replace 192.168.1.50 with your instance’s actual IP address. If the login succeeds, you will land directly in the host OS shell—even before some web services have initialized.

Troubleshooting

  • Permission denied: Passwords are never accepted. Verify whether line breaks were accidentally introduced when copying the public key, and make sure your -i parameter points to the correct private key. For more fundamentals, see the guide on setting up a Raspberry Pi SSH connection.
  • No connection after running the add-on: Reboot the hardware (e.g., by power-cycling the device). Alternatively, generate a new key pair using ssh-keygen and re-enter the new public key in the add-on.

With root access established, you can troubleshoot severe system failures directly and debug hardware issues at the kernel level.

Sources: Forum: Home Assistant Community, simon42.com

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top