added autolaunch of update-ssh-keys.sh
This commit is contained in:
parent
488bce9b5e
commit
b66439805e
3 changed files with 23 additions and 1 deletions
7
config/update-ssh-keys.service
Normal file
7
config/update-ssh-keys.service
Normal 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
|
11
config/update-ssh-keys.timer
Normal file
11
config/update-ssh-keys.timer
Normal 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
|
||||
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue