SSH into HassOS

If you have the SSH add-on installed and working, you should also be able to use your favorite SFTP utility to copy files to the /config (or other) share. The SAMBA add-on also works.

I also had to edit my private key and change the end of line from the windows default to (LF). You may want to edit your detailed directions to add this.

Strange. I was able to ssh into the host using ssh [email protected] -p 22222 but when I logged out using exit and tried to do exactly the same again I got

Error response from daemon: stat /mnt/data/docker/overlay2/f65e25c6430b7bc1be3d5fc90452a1b359f4ff2a88933ad9db4b6c2840ac21fa: no such file or directory

Is there a way to connect directly to ash shell?
With old ResinOS I was able to use WinSCP to browse filesystem and edit file within addon’s containers. Now I was able to connect to 22222 with putty but I need to issue a “login” command before gain access to ash shell…
WinSCP connections fails because don’t recognize command interpreter

image

I can’t get this to work. I have followed this guide to the letter, but I only get connection refused.
I cannot for the life of me understand what I’m doing wrong.

The logs doesn’t tell much either.
I see this, but that’s it:

21-03-03 09:35:10 INFO (MainThread) [supervisor.hardware.monitor] Detecting HardwareAction.ADD usb hardware /dev/bus/usb/001/011
21-03-03 09:35:26 INFO (MainThread) [supervisor.hassos] Synchronizing configuration from USB with Home Assistant Operating System.
21-03-03 09:35:26 INFO (MainThread) [supervisor.host.services] Restarting local service hassos-config.service

I can’t get it to work. authorized_keys file is there, transfered it with WinSCP to root folder and then used mv command to move it to .ssh (via Terminal SSH addon). Putty always returns Connection Refused error. Import from USB button doesn’t seem to do anything.

2 Likes

I do this but show me in putty this:
Unable to load private key file “C:\Users\Piotrek\Desktop\key_private.ppk” (PuTTY key format too new)

Anybody can help…

I used following Version with putty/puttygen:


maybe this helps

Hi!

I’m struggling with this problem too. I followed the instructions but got the same problem as @pepeEL. I have created manually the authorized_keys files with SSH & Terminal Addon since the Import From USB method seems to do nothing at all (tried NTFS, FAT and FAT32 formats).

Is it supposed to create a id_rsa file in .ssh folder? I’m doing this to run [New Addon] Samba NAS. (Mount external disk and share it ) - Share your Projects! - Home Assistant Community (home-assistant.io). In the logs of this addon it seems to look for a id_rsa file that does not exist:

Warning: Permanently added ‘[192.168.1.4]:22222’ (ECDSA) to the list of known hosts.
Load key “/root/.ssh/id_rsa”: invalid format
[email protected]: Permission denied (publickey).

Any help will be REALLY appreciated!

I wonder what is under the hood. I heed to install the key and enable ssh without UI access (as it does not boot up due to the ?known? DNS-500error.

If the key is generated with PuttyGen, that is no longer accepted by the current (10.0.0) version of SSH addon. Version 9.1.1 works fine.

Tearing my hair out also with same issue. I have latest HA with SSH/Terminal add on installed. I can use terminal on the box and have add public keys via the Configuration UI with the syntax in the docs. I have tried both keys generated with PuttyGen AND ssh-keygen. The public keys are correctly saved into /root/.ssh/authorized_keys. The UI shows these as

authorized_keys:
  - >-
    ssh-rsa
    ...key...
    name

Using the PPK file in Putty fails with

But when I use command line SSH with a private key created with ssh-keygen, ssh -i pvt_key_file root@IP, that works, but that same key, imported to Puttygen and saved as PPK, does not work.

@realthk does your comment above ‘generated’ with PuttyGen actually mean any PPK file saved by PuttyGen?

It doesnt work with rsa keys anymore. Try the ed25519 key instead

Thanks @DavidFW1960 - I was using Putty 0.70, which needed an update to 0.77 for it to import the ed25519 key - but now having generated the PPK file with the new Puttygen and set up the ed25519 public key, I can ssh with Putty.

1 Like

I have no idea why they changed it and it took me ages to figure it out.

At least there’s a solution for those who search :slight_smile:

The documentation is lagging behind the HA product - I get that it’s a challenge to keep docs current, but I am having many issues, where the docs just don’t give enough info for someone to get started.

Not sure how this solution could get back into the SSH terminal documentation…?

Hahaha…
Try running a shell command that runs an ssh session on another host and it will ONLY work with an rsa key. Its totally inconsistent. However in this case if you had googled the error that ths rsa key was not accepted you would have found the solution. It’s not speciific to this addons. The logs show the normal linux type errors…

The links provided near the top are now 404. The instructions are now at: operating-system/configuration.md at 064772d0bb3662d38bfe366764990a6dfe124d2f · home-assistant/operating-system · GitHub