#Wake on lan shutdown via SSH

1 messages · Page 1 of 1 (latest)

upbeat coyote
#

I want to basically run ssh [user]@[host] shutdown /s /t 10 for (obviously) a windows host.

I can run the ssh from the terminal addon no problem using an ssh key but I get an 255 error when running it with the WOL switch turn-off action.

I tried following the official guide and created an .ssh folder in /config. Also tried adding the ssh keys into the .ssh folder.

Still getting the 255 error.

jagged shoal
upbeat coyote
upbeat coyote
#

(I was using the cli addon, will try using the advanced terminal addon tomorrow.)

jagged shoal
#

Well these instructions are meant for HAOS, actually. HA runs in a docker container there too.

upbeat coyote
#

Oh wait what really?

Oh. (I forgot to try it oops, i will come back to this)

#

If i has known that, I would have just installed it with docker damn

jagged shoal
#

I usually recommend that to advanced users anyways.

upbeat coyote
#

What are the main differences between HAOS and just plain docker?

I read that mainly updating is easier with HAOS but I already have several cts running docker containers.

Do you think running in docker would be nicer for me?

Tl;dr:
what would make me choose docker instead of haos?

#

(Especially if i‘m already virtualizing and not dedicating the whole machine to home assistant)

jagged shoal
#

There's a table here: https://www.home-assistant.io/installation/#about-installation-types
For most people it's the apps and their integration into the GUI that makes them choose it. Or likely unfamiliarity with containers. I feel like HAOS apps are too opinionated and restrictive and you can't choose a version you want either. HAOS itself is both restrictive (no package manager, mostly read only/immutable) and somewhat bloated and opaque by design. DNS works very strangely too. Not everyone cares or takes note about this though. If you already have docker containers anyway you ain't missing anything by avoiding it.

upbeat coyote
#

Alright, might migrate to docker then.

Is there a way to keep my stuff when doing this?

#

*easy way

jagged shoal
#

You can restore the core part of the backup. I'd create a unencrypted one and extract the core part manually into the bind mount.

#

Where do you run HAOS on right now? Where the docker containers?

upbeat coyote
#

Basically different "machines".

HAOS runs as a VM on my proxmox and my docker containers run in several CTs

#

(LXCs)

jagged shoal
#

Similar story here. The only real issue with running HA in a CT I've noticed so far is that it can't determine the CPU/Memory usage and such properly. I use podman to save even more memory.

shadow sundial
#

I differ from opinion. But everybody has to make their own opinion of course! I just don't agree it's "recommended for advanced users anyways". I'll not recommend containers for beginners but that does not make the other way around automatically true for me.

I also run containers for other stuff but like the complete package HAOS gives me. Nice and separated from the rest, just for home automation. And it nicely integrates with the addons apps. And just runs as a VM in Proxmox. If it's not home automation related or to complex I can always spin up a container. GUI does not give you version select but And imho network=host sucks so you then need to go the macvlan route.

But yeah, installing a specific version of an app is unfortunately still not a thing, not even in the CLI. But realistically, I never used it for my production HA as I will just restore a backup if things are not okay. And if you really need it you can always manipulate the backup to fake a specific version. Yes, here it gets very hacky compared to Docker. But like I said, did it only once on my test HA, never on my production HA.

upbeat coyote
#

Interesting, will keep this in mind. I think for now it‘s also more convenient for me to use haos.

#

I‘m feeling stupid which credentials/key do i need for the advanced ssh app? Do i need to add the public key of HA there?

I may be stupid lol

shadow sundial
#

For the advanced SSH to connect to HA? Or for the shutdown?

jagged shoal
upbeat coyote
#

putting in the public key worked

#

oh

#

my HA cannot reach my pc ???

#

i cannot ping it

#

it resolves the dns i set in my dns server but it won't reach the pc

jagged shoal
#

Share what you see.

upbeat coyote
jagged shoal
#

Can the SSH app alone ping it? Windows oftne doesn't respond to them.

upbeat coyote
#

guess that's not an HA issue then 🤔

#

nope

jagged shoal
#

Bad test then 😄

upbeat coyote
#

fucking windows

jagged shoal
#

Test your SSH command.

upbeat coyote
#

also tried that, not connecting

jagged shoal
#

From neither option?

upbeat coyote
#

ye

shadow sundial
upbeat coyote
#

okay

#

my windows firewall seems to be the problem

#

i cannot ping it from any container

#

it just doesn't get any responses from windows

jagged shoal
upbeat coyote
#

hold on fsr i cannot even connect from my other containers, i'll try my pve host

#

nope not even that, weird

#

i had ssh working once wtf?

jagged shoal
#

🤷

upbeat coyote
#

hold on maybe a windows update made my firewall go byebye

#

actually no the firewall rule is still intact...

#

found it

#

idk why but i had to allow connections from public networks in windows

#

i hate windows oh my god

jagged shoal
#

Maybe your network is set to being public for some reason?

upbeat coyote
#

must be

#

why? no damn idea

upbeat coyote
#

windows being windows

#

why lol

#

windows probably automatically changed it at some point

#

anyway thank you

#

i hope it will work now

upbeat coyote
#

idk why but the ssh keys wont work

upbeat coyote
#

After lots of tinkering, I enabled the verboser debug log for windows sshd using this thread
there it reported to me that the authorized_keys file had too many allowed users.
i had to remove my main admin account from the shutdown user i created. now it works like a charm!

#

thank you!