Can't restart the SSH Daemon

Hi,

I use the HA supervised edition.
I am about to add ssh key files to all my systems in order add some security over passwords only. After adding the public key to the authorized_keys files on home assistant, I set

PasswordAuthentication no

in /etc/ssh/sshd_config

However, I am struggeling to restart the ssh service.
Tried a lot of commands like

service sshd restart

or

systemctl sshd restart

or

/etc/init.d/sshd restart

none of these commands do work.

Does anyone know how to restart the ssh daemon in home assistant?

You can just restart the SSH add-on, that will restart the service.

sudo systemctl restart ssh

But, honestly, I’m not sure why you chose Supervised over HAOS if you stumble on this basic Debian command :wink:

thanks for pointing me to the ssh-addon.
I didn’t realize that I have to configure ssh via this addon rather than via cli.
I added my public key into the settings of this addon and also remove the password. After that I restarted the plugin.
I am able to login via keyfile. However I am still able to login via password. Do you have any idea why?
In /etc/ssh/sshd_config
PasswordAuthentication no is being set correctly via the addon. :thinking:

I guess I was expecting a smartass answer like this. Unfortunately your answer doesn’t make any sense, since the systemctl command doesn’t exist in the HA docker container.

Pal, as you don’t know what you’re doing, you’re relying on smartasses to assist you.
Now, that’s one less.

a hint for your next smartass comment: first understand the question, second write something which does make sense.

Edit: and by the way. Do you really believe that you’re comment was helpful in any way??

A HA Supervised installation require a lot of understanding of the administrator.
You can actually have a SSH service running on the host, as an addon and also directly to the HA host, so which one are you trying to change and in what environment are you making those changes?

Pal, you are using supervised (or so you say).

That implies that you have SSH configured at the OS level (or that you use keyboard/screen, but let’s assume not).

On debian, you’re configuring the SSH daemon through /etc/ssh/sshd_config as you mentioned.
It seemed not so smartass to assume you were talking about that SSH, not the addon one. The smartass confirms you restart that SSH daemon through the command above.

The smartass tells you that editing /etc/ssh/sshd_config inside the addon is pointless, as that will be lost at next restart.
I suggest you to be your own smartass and read the addon configuration to configure key authentication.

I stand to my smartass remark that if you cannot restart a daemon under debian, the Supervised install method is not for you.

Hi,

I had to get the addon config right. Now it works. thx

1 Like

It’s good that you stand to your toxic useless trolling. :wink:

Have a nice day. :slight_smile: