Wer wie ich Hass.io auf dem Synology NAS nutzt, wird früher oder später bei der Installation des Add-Ons SSH & Web Terminal feststellen, dass dieses nach der Installation nicht startet: Es beschwert sich über zu großzügige Dateirechte auf zwei Schlüsseldateien.
[11:39:57] INFO: Starting the Home Assistant STDIN service... [11:39:57] INFO: Starting the SSH daemon... [11:39:57] INFO: Starting the ttyd daemon... @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0755 for '/data/ssh_host_rsa_key' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Unable to load host key "/data/ssh_host_rsa_key": bad permissions Unable to load host key: /data/ssh_host_rsa_key @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: UNPROTECTED PRIVATE KEY FILE! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ Permissions 0755 for '/data/ssh_host_ed25519_key' are too open. It is required that your private key files are NOT accessible by others. This private key will be ignored. Unable to load host key "/data/ssh_host_ed25519_key": bad permissions Unable to load host key: /data/ssh_host_ed25519_key sshd: no hostkeys available -- exiting.
Weshalb dieser Fehler offenbar nur bei der Installation von Hass.io über das Synology Paket auftritt, kann ich leider nicht sagen, die Entwickler des Add-Ons haben sich leider auch nicht weiter dafür interessiert (https://github NULL.com/hassio-addons/addon-ssh/issues/110). Man kann den Fehler aber recht einfach manuell beheben:
- Das Add-On SSH & Web Terminal ist zunächst regulär über den Hass.io Add-On Store zu installieren
- In der Konfiguration sind zumindest Username und Password einzutragen und in der Network-Karte ist ein von Port 22 abweichender SSH-Port einzutragen, z.B. 2222
- Nun muss im DSM, also der Synology Weboberfläche, der SSH-Zugriff auf den DSM kurzzeitig aktiviert werden: Systemsteuerung -> Terminal & SNMP -> [X] SSH-Dienst akivieren.
- Nach kurzer Wartezeit kann man sich nun per SSH, z.B. mit PuTTY, mit den von der Weboberfläche gewohnten Login-Daten am DSM anmelden.
- Mittels
sudo -i
wechselt man zum root-Benutzer (erneut wird das Passwort abgefragt). - Nun muss man das Verzeichnis finden, in dem sich die Schlüsseldateien befinden und dort hinein wechseln:
cd /volume1/docker/hass.io/addons/data/a0d7b954_ssh
- Dann lassen sich die Rechte einfach korrigieren:
chmod 600 *_key
- Abschließend sollte man nun unter Systemsteuerung -> Terminal & SNMP wieder den SSH-Dienst deaktivieren.
Hier einmal der Ablauf auf meinem Gerät:
root@nas:~# cd /volume1/docker/hass.io/addons/data root@nas:/volume1/docker/hass.io/addons/data# ls 89275b70_dss_voip a0d7b954_appdaemon3 a0d7b954_nodered a0d7b954_ssh a0d7b954_vscode core_check_config root@nas:/volume1/docker/hass.io/addons/data# cd a0d7b954_ssh root@nas:/volume1/docker/hass.io/addons/data/a0d7b954_ssh# ls -lisa total 20 102454 0 drwxr-xr-x+ 1 root root 236 Dec 28 12:15 . 311 0 drwxr-xr-x+ 1 root root 192 Dec 28 12:13 .. 102479 0 -rwxr-xr-x+ 1 root root 0 Dec 28 12:15 .gitconfig 102461 4 -rwxr-xr-x+ 1 root root 436 Dec 28 12:15 options.json 102478 0 drwx------ 1 root root 0 Dec 28 12:15 .ssh 102473 4 -rwxr-xr-x+ 1 root root 432 Dec 28 12:15 ssh_host_ed25519_key 102474 4 -rwxr-xr-x+ 1 root root 113 Dec 28 12:15 ssh_host_ed25519_key.pub 102471 4 -rwxr-xr-x+ 1 root root 2622 Dec 28 12:15 ssh_host_rsa_key 102472 4 -rwxr-xr-x+ 1 root root 585 Dec 28 12:15 ssh_host_rsa_key.pub 102477 0 -rw------- 1 root root 0 Dec 28 12:15 .zsh_history root@nas:/volume1/docker/hass.io/addons/data/a0d7b954_ssh# chmod 600 *_key root@nas:/volume1/docker/hass.io/addons/data/a0d7b954_ssh# ls -lisa total 20 102454 0 drwxr-xr-x+ 1 root root 236 Dec 28 12:15 . 311 0 drwxr-xr-x+ 1 root root 192 Dec 28 12:13 .. 102479 0 -rwxr-xr-x+ 1 root root 0 Dec 28 12:15 .gitconfig 102461 4 -rwxr-xr-x+ 1 root root 436 Dec 28 12:15 options.json 102478 0 drwx------ 1 root root 0 Dec 28 12:15 .ssh 102473 4 -rw------- 1 root root 432 Dec 28 12:15 sh_host_ed25519_key 102474 4 -rwxr-xr-x+ 1 root root 113 Dec 28 12:15 ssh_host_ed25519_key.pub 102471 4 -rw------- 1 root root 2622 Dec 28 12:15 ssh_host_rsa_key 102472 4 -rwxr-xr-x+ 1 root root 585 Dec 28 12:15 ssh_host_rsa_key.pub 102477 0 -rw------- 1 root root 0 Dec 28 12:15 .zsh_history root@nas:/volume1/docker/hass.io/addons/data/a0d7b954_ssh#
Das war’s schon! Das SSH & Web Terminal Add-On sollte sich nun fehlerfrei starten lassen. Wenn man vorher noch den Schiebeschalter Show in sidebar aktiviert, kann man nun bequem über den Web Browser auch per SSH auf Hass.io zugreifen.