I cannot SSH into HAOS

I have HAOS installed on a Raspberry Pi 3B+. I can’t hook up a keyboard and monitor to it.

I need to SSH into HAOS (not HA Core or whatever the terminal add-on gives you access to*) to troubleshoot an issue I have with the storage used.

I tried to follow this guide:Debugging the Home Assistant Operating System | Home Assistant Developer Docs

  1. I formatted my USB drive to FAT32 (or NTFS, I don’t actually remember, now) with the right name all in caps;
  2. I created a pair of keys with putty, renamed the public key, opened it with Notepad++, converted it to AINSI and linux EOL;
  3. USB drive in the Raspberry Pi, I ran the ha os import command (several times, using different USB ports) and, since the guide says rebooting would do the same, I also rebooted;
  4. Launched the latest Putty (0.80), tried to connect to [email protected] (or the same with the IP address) using the key and always get the same error: Connection refused.

What can I do to solve this? Could I use the terminal add-on to check if the key was properly imported (at the HAOS level, not the HA Core one)?

*The ins and outs (the OS, the superviser, the docks, etc.) aren’t 100% in my mind.

Can’t you just resolve the issue through the command line that is shown in the background?

  1. I can’t because the command line in the background is not the HAOS but HA Core (or something like that). So it sees only a small fraction of the storage used;
  2. Even if I could, I’d still be interested in knowing why I can’t setup the SSH for HAOS.

I think that you have just seen this:

HOWTO: How to access the Home Assistant OS host itself over ssh - Installation / Home Assistant OS - Home Assistant Community (home-assistant.io)

Maybe you can ask under this thread

That error suggests that HA is still rejecting the connection. Assuming you’re using the right port (22222), then that error would suggest that SSH isn’t running in the HA OS. I presume, since the docs don’t explicitly mention it, that the SSH server is started once the key is imported. Could be that even though the import command succeeded, HA OS doesn’t like the key that was imported.

The formatting of the default save type of the public key is wrong. Instead of saving, you’ll want to copy the generated key into a text doc with the right formatting.

I’m also not a huge user of PuTTY (typically just use Powershell) but I think you’ll also have to import the private key to be used for authentication when you connet.

Well, I read 2222 on the guide and since I’m an idiot, I didn’t double-check.

So thank you, it works!

Yeah I did that.

Random question but do you know if I could have generated the key with Powershell with the right format and used it after with PuTTy? I could try but I don’t want to break it now that it works (and my understanding too limited to troubleshoot it afterwards) :grimacing:

Totally…or just use Powershell for both. When you generate a key with Powershell, by default it’ll drop it into the .ssh folder for your user profile. I know Powershell looks into that folder by default, but I don’t know if PuTTy does. If it doesn’t, you can just import the key.

I’m asking because I generated a key with Powershell first and the key itself mentioned Powershell at the end.

I like PuTTy because you can use the standalone .exe
I have that .exe in a dropbox folder where I put my SSH keys and config as well, which means I can access all computers from any computer I own without having to move keys around. I suppose you could do the same with Powershell but not as easily. And without a GUI.