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?
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.
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.
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?
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.