added autolaunch of update-ssh-keys.sh

This commit is contained in:
jirka1324 2025-02-02 14:11:10 +01:00
parent 488bce9b5e
commit b66439805e
3 changed files with 23 additions and 1 deletions

View file

@ -0,0 +1,7 @@
[Unit]
Description=Update SSH authorized_keys from Git
After=network.target
[Service]
User=root
ExecStart=/usr/bin/update-ssh-keys.sh

View file

@ -0,0 +1,11 @@
[Unit]
Description=Run update-ssh-keys script every 10 minutes
[Timer]
OnBootSec=5m
OnUnitActiveSec=10m
Unit=update-ssh-keys.service
[Install]
WantedBy=timers.target

View file

@ -18,4 +18,8 @@ systemctl restart sshd
echo "SSH je nyní nastaveno pouze pro přihlašování pomocí klíčů."
cp ./update-ssh-keys.sh /usr/bin/update-ssh-keys.sh
cp ./config/update-ssh-keys.service /etc/systemd/system/update-ssh-keys.service
cp ./config/update-ssh-keys.timer /etc/systemd/system/update-ssh-keys.timer
systemctl daemon-reload
systemctl enable --now update-ssh-keys.timer