mirror of
https://github.com/home-assistant/operating-system.git
synced 2025-07-28 15:36:29 +00:00
Fix authorized_keys keys (#53)
* Fix authorized_keys keys * Update hassos.conf * Update configuration.md * Update hassos-config * Update hassos-config
This commit is contained in:
parent
69af4b3819
commit
38bc2b4f91
@ -6,13 +6,13 @@ You can format a USB stick with FAT32/EXT4 and name it with `config`. The layout
|
|||||||
```
|
```
|
||||||
network/
|
network/
|
||||||
modules/
|
modules/
|
||||||
known_hosts
|
authorized_keys
|
||||||
hassos-xy.raucb
|
hassos-xy.raucb
|
||||||
```
|
```
|
||||||
|
|
||||||
- On `network` folder can hold any kind of NetworkManager connections files.
|
- On `network` folder can hold any kind of NetworkManager connections files.
|
||||||
- The folder `modules` is for modules-load configuration files.
|
- The folder `modules` is for modules-load configuration files.
|
||||||
- `known_hosts` file activate debug SSH access of port `22222`.
|
- `authorized_keys` file activate debug SSH access of port `22222`.
|
||||||
- For firmware updates you can but the `hassos-*.raucb` OTA update they should be install.
|
- For firmware updates you can but the `hassos-*.raucb` OTA update they should be install.
|
||||||
|
|
||||||
You can put this USB stick into device and they will be read on startup. You can also trigger this process later over the
|
You can put this USB stick into device and they will be read on startup. You can also trigger this process later over the
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[Unit]
|
[Unit]
|
||||||
RequiresMountsFor=/etc/dropbear
|
RequiresMountsFor=/etc/dropbear
|
||||||
ConditionFileNotEmpty=/root/.ssh/known_hosts
|
ConditionFileNotEmpty=/root/.ssh/authorized_keys
|
||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
ExecStartPre=
|
ExecStartPre=
|
||||||
|
@ -1,10 +1,15 @@
|
|||||||
#!/bin/sh
|
#!/bin/sh
|
||||||
|
|
||||||
|
if ! findfs LABEL="config" > /dev/null; then
|
||||||
|
echo "[Warning] No config partition found"
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
# Mount config folder
|
# Mount config folder
|
||||||
systemctl start mnt-config.mount
|
systemctl start mnt-config.mount
|
||||||
if ! systemctl -q is-active mnt-config.mount; then
|
if ! systemctl -q is-active mnt-config.mount; then
|
||||||
echo "[Warning] No config partition found"
|
echo "[Error] Can't mount config partition"
|
||||||
exit 0
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
##
|
##
|
||||||
@ -29,15 +34,15 @@ fi
|
|||||||
|
|
||||||
##
|
##
|
||||||
# SSH know hosts
|
# SSH know hosts
|
||||||
if [ -f /mnt/config/known_hosts ]; then
|
if [ -f /mnt/config/authorized_keys ]; then
|
||||||
echo "[Info] Update SSH known_hosts!"
|
echo "[Info] Update SSH authorized_keys!"
|
||||||
|
|
||||||
cp -f /mnt/config/known_hosts /root/.ssh/known_hosts
|
cp -f /mnt/config/known_hosts /root/.ssh/authorized_keys
|
||||||
chmod 600 /root/.ssh/known_hosts
|
chmod 600 /root/.ssh/authorized_keys
|
||||||
|
|
||||||
systemctl start dropbear
|
systemctl start dropbear
|
||||||
else
|
else
|
||||||
rm -f /root/.ssh/known_hosts
|
rm -f /root/.ssh/authorized_keys
|
||||||
systemctl stop dropbear
|
systemctl stop dropbear
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user