Les deux révisions précédentesRévision précédenteProchaine révision | Révision précédenteDernière révisionLes deux révisions suivantes |
admin:services:apt-dater [2014/10/22 16:38] – [Installer apt-dater sur une machine de management] zertrin | admin:services:apt-dater [2020/04/25 23:33] – [Liens (potentiellement) utiles] klafyvel |
---|
| |
====== Infos générales ====== | ====== Infos générales ====== |
| |
| |
===== Liens (potentiellement) utiles ===== | |
| |
* Site officiel : http://www.ibh.de/apt-dater/ | |
* Référence pour la config et la sécurisation d'apt-dater : https://sdeziel.info/apt-dater/index.html | |
| |
===== En speed ==== | ===== En speed ==== |
Sur **chaque** machine(s) concernée(s) (en gros [[admin:serveurs:hexagon|hexagon]], [[admin:serveurs:quigon|quigon]] et [[admin:serveurs:baldrick|baldrick]]): | Sur **chaque** machine(s) concernée(s) (en gros [[admin:serveurs:hexagon|hexagon]], [[admin:serveurs:quigon|quigon]] et [[admin:serveurs:baldrick|baldrick]]): |
| |
:!: Attention ici exemple de zertrin, adapter **la clef et les IP autorisées** à votre cas ! | :!: Attention ici exemples de zertrin et David_5.1, adapter **les clefs et les IP autorisées** à votre cas ! |
| |
| # en tant que root |
cat << EOF >> ~aptdater/.ssh/authorized_keys | cat << EOF >> ~aptdater/.ssh/authorized_keys |
command="exec /usr/local/bin/apt-dater-host-wrapper",no-user-rc,no-X11-forwarding,from="127.0.0.1,5.135.159.117,2001:41d0:8:d975::1" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpwXiaxQhSI/9jyxmsVewnsBQeBNWZZhoZaGfpFHWsciy1j/+hC5ectW6kvsbm6mf4YkKx2Hc29oRSm7lsyv3+itBS5HbnzHtdbaKTeWKZIhXI/TlMw8RA0+5qX9vKT0sJhkqFyZoXRpw9tKh7+zehez1FFJV60y8U/qm4mXlgiLZcVh4hXG+U7JfxYAQntWf47sNNoqG06CVFTJs8NR6WE6kpvZTNZrBoHwzdVbPKKaRRrgjyUx7Qxb/1XUnv+Iwe5ZYUlyMF+2jAM1YXk9+fnCkaEIWsJTHEsrVGZaUlDu9qVQOUun4B2kU8pqUK9oqKp7svsqtboi5mWGhcNkMN zertrin@example.net | no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc,no-X11-forwarding,from="127.0.0.0/8,91.121.177.109,2001:41d0:1:f26d::1" ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBADNkXj0+teRl15r6PasiFBCSy4TPIzBQwpyR+DqDwkd4l6B23wY0A/psfZMoSPV6c2PxgOh7WKZMMrturZTR4wUBAACUHVxJCvroLwbaJvJNqVRBqUhNluWoNLSVpSIskoGOEf9E1dtAM24nZdqThBUFTnK7Ws2umPtiybncpUJOL/UPg== david@sinquin/ks51 |
| no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc,no-X11-forwarding,from="127.0.0.0/8,91.121.136.69,2001:41d0:1:b745::1" ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIO2O2dQgm7g2/M2Jg9xkSKhPqjHTK/Jx0pOIVP/CDSuv zertrin@gluon |
EOF | EOF |
| |
Hosts=aptdater@hexagon.federez.net;aptdater@quigon.federez.net;aptdater@baldrick.federez.net; | Hosts=aptdater@hexagon.federez.net;aptdater@quigon.federez.net;aptdater@baldrick.federez.net; |
| |
Relancer apt-dater, les serveurs seront dans la section ''Unknown''. Rafraichir les serveurs avec la commande '' g ''. En cas de soucis, la commande '' e '' aide au diagnostic. | Relancer apt-dater, les serveurs seront dans la section ''Unknown''. Rafraichir les serveurs avec la commande ''g''. En cas de soucis, la commande ''e'' aide au diagnostic. |
| |
====== Mise en place initiale d'apt-dater sur les machines managées ====== | ====== Mise en place initiale d'apt-dater sur les machines managées ====== |
| |
| Note: toutes les étapes ci-dessous se font en tant que superutilisateur. |
===== Installation ===== | ===== Installation ===== |
| |
| |
adduser --quiet --system --home /var/lib/aptdater --group --shell /bin/sh aptdater | adduser --quiet --system --home /var/lib/aptdater --group --shell /bin/sh aptdater |
| adduser aptdater ssh |
| |
==== Configuration de SSH pour apt-dater ==== | ==== Configuration de SSH pour apt-dater ==== |
Ajout de la clef d'un admin dans le authorized_keys d'aptdater: | Ajout de la clef d'un admin dans le authorized_keys d'aptdater: |
| |
:!: Attention ici exemple de zertrin, adapter la clef et les IP autorisées à votre cas ! | :!: Attention ici exemple de David_5.1, adapter la clef et les IP autorisées à votre cas ! |
| |
| touch ~aptdater/.ssh/authorized_keys |
| chown aptdater: -R ~aptdater/.ssh |
cat << EOF >> ~aptdater/.ssh/authorized_keys | cat << EOF >> ~aptdater/.ssh/authorized_keys |
command="exec /usr/local/bin/apt-dater-host-wrapper",no-user-rc,no-X11-forwarding,from="127.0.0.1,5.135.159.117,2001:41d0:8:d975::1" ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDpwXiaxQhSI/9jyxmsVewnsBQeBNWZZhoZaGfpFHWsciy1j/+hC5ectW6kvsbm6mf4YkKx2Hc29oRSm7lsyv3+itBS5HbnzHtdbaKTeWKZIhXI/TlMw8RA0+5qX9vKT0sJhkqFyZoXRpw9tKh7+zehez1FFJV60y8U/qm4mXlgiLZcVh4hXG+U7JfxYAQntWf47sNNoqG06CVFTJs8NR6WE6kpvZTNZrBoHwzdVbPKKaRRrgjyUx7Qxb/1XUnv+Iwe5ZYUlyMF+2jAM1YXk9+fnCkaEIWsJTHEsrVGZaUlDu9qVQOUun4B2kU8pqUK9oqKp7svsqtboi5mWGhcNkMN zertrin@gmail.com | no-agent-forwarding,no-port-forwarding,no-X11-forwarding,no-user-rc,no-X11-forwarding,from="127.0.0.0/8,91.121.177.109,2001:41d0:1:f26d::1" ecdsa-sha2-nistp521 AAAAE2VjZHNhLXNoYTItbmlzdHA1MjEAAAAIbmlzdHA1MjEAAACFBADNkXj0+teRl15r6PasiFBCSy4TPIzBQwpyR+DqDwkd4l6B23wY0A/psfZMoSPV6c2PxgOh7WKZMMrturZTR4wUBAACUHVxJCvroLwbaJvJNqVRBqUhNluWoNLSVpSIskoGOEf9E1dtAM24nZdqThBUFTnK7Ws2umPtiybncpUJOL/UPg== david@sinquin/ks51 |
EOF | EOF |
| |
chown aptdater: -R ~aptdater/.ssh | |
| |
==== Configuration de sudo pour apt-dater ==== | ==== Configuration de sudo pour apt-dater ==== |
| |
cat << "EOF" > /etc/sudoers.d/apt-dater-host | cat << "EOF" >> /etc/sudoers.d/apt-dater-host |
# package installation is denied | # package installation is denied |
aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get update | aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get update |
aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get dist-upgrade | aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get dist-upgrade |
aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get --assume-yes dist-upgrade | aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get --assume-yes dist-upgrade |
| aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get dist-upgrade --assume-yes |
aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get --quiet --simulate --fix-broken --allow-unauthenticated dist-upgrade | aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get --quiet --simulate --fix-broken --allow-unauthenticated dist-upgrade |
| aptdater ALL = (root) NOPASSWD: /usr/bin/apt-get dist-upgrade --quiet --simulate --fix-broken --allow-unauthenticated |
| aptdater ALL = (root) NOPASSWD: /usr/sbin/needrestart |
EOF | EOF |
| |
chmod 0440 /etc/sudoers.d/apt-dater-host | chmod 0440 /etc/sudoers.d/apt-dater-host |
| |
| ==== Demande de validation des mise à jour ==== |
| |
| Pour qu'une demande de confirmation de la liste des paquets à mettre à jour soit faite, il faut modifier ''/etc/apt-dater-host.conf'' pour qu'il contienne ''ASSUMEYES=0;'' : |
| sed -i 's/^$ASSUMEYES=1;$/$ASSUMEYES=0;/' /etc/apt-dater-host.conf |
==== Limitation de la priorité d'apt-dater apt-dater (optionnel) ==== | ==== Limitation de la priorité d'apt-dater apt-dater (optionnel) ==== |
| |
| |
==== Création d'un wrapper pour sécuriser apt-dater ==== | ==== Création d'un wrapper pour sécuriser apt-dater ==== |
| |
| <WRAP center round important 60%> |
| Ce qui suit n'a jamais été aperçu en état de marche, il est donc déconseillé de l'appliquer sans autre forme de procès. |
| </WRAP> |
| |
À placer dans ''/usr/local/bin/apt-dater-host-wrapper'' | À placer dans ''/usr/local/bin/apt-dater-host-wrapper'' |
| |
chmod 0755 /usr/local/bin/apt-dater-host-wrapper | chmod 0755 /usr/local/bin/apt-dater-host-wrapper |
| |
| ======= Le contrôleur ======= |
| |
| Se référer à la page du [[services:apt-dater:controller|contrôleur]] pour une explication sur son installation. |
| |
| |
| ====== Liens (potentiellement) utiles ====== |
| |
| * Site officiel : http://www.ibh.de/apt-dater/ |
| * Référence pour la config et la sécurisation d'apt-dater : https://sdeziel.info/apt-dater/index.html |
| |
| |