IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)

Installation et sécurisation d'une station Debian 3.0 stable

15/05/2004




I. INFORMATIONS SUR LA GESTION DE PACKAGES DEBIAN
I.a. Création d'un package Debian


I. INFORMATIONS SUR LA GESTION DE PACKAGES DEBIAN


La gestion des packages Debian peut s'effectuer par le biais de plusieurs commandes.
=> Consultez les man suivants : dselect , apt-get , dpkg

Nous nous contentons de présenter ici quelques d'aide-memoires.

NDR: Attention aux permissions système de fichiers associées à vos partitions.

Mise à jour du système avec apt : apt-get update apt-get dist-upgrade -d cd /var/cache/apt/archives Vérifier l'empreinte md5 du(des) package(s) telecharge(s). dpkg-deb -I {nom_du_package}.deb md5sums
=> Vérifiez que les md5 sont corrects (?) apt-get dist-upgrade Quelques utilisations de dpkg : dpkg -i package => Installer un .deb dpkg -I package => Informations sur le .deb dpkg -c package => Liste les fichiers d'un .deb dpkg -x package toto => Extrait les fichiers du .deb dans le répertoire 'toto'. dpkg -l => Tous les packages installes. dpkg -l '*pattern*' => Tous les packages installes relatifs à 'pattern'. dpkg -L package => Liste des fichiers d'un package installe. dpkg -s package => Statut d'un package Repertoires relatifs a la gestion de package Debian : /var/cache/apt/archives => contient la liste des packages téléchargés s'ils ne sont pas effacés. /var/lib/dpkg/info/* => contient les informations relatives aux packages installes.


I.a. Création d'un package Debian


AVERTISSEMENT : Cette création de package est plus artisanale qu'autre chose. Je vous conseille la lecture de www.debian.org/doc/manuals/maint-guide/ pour la création de package .deb standards. NDR : Nous nous servons de l'utilitaire 'fakeroot' dont je ne vous recomande pas l'installation sur un serveur de production.

On crée l'arborescence :

mkdir ~/tmp/debian-secinst-doc-0.0.1 cd ~/tmp/debian-secinst-doc-0.0.1 mkdir -p usr/local/doc cp ~/debian-secinst.txt ./usr/local/doc/ mkdir DEBIAN
On crée les fichiers de contrôle :

cat > ./DEBIAN/control << EOF Package: debian-secinst-doc Version: 0.0.1 Section: doc Priority: optional Architecture: all Depends: Maintainer: Simon Castro <scastro@entreelibre.com> Description: Installation et sécurisation d'une station Debian Woody\ stable Installation et sécurisation d'une station sous Linux Debian 3.0 stable. EOF cat > ./DEBIAN/copyright << EOF debian-secinst-doc Copyright (c) 2003 - Simon Castro <scastro [at] entreelibre.com> This package may be downloaded from http://www.entreelibre.com/scastro You are free to distribute this software under the terms of the GNU General Public License. On Debian systems, the complete text of the GNU General Public License can be found in the file '/usr/share/common/common-licenses/GPL' EOF cat > ./DEBIAN/changelog << EOF debian-secinst-doc (0.0.1) * Initial release - Simon Castro <scastro [at] entreelibre.com> -- Simon Castro <scastro [at] entreelibre.com> 2003-03-17 EOF
On genere les empreintes MD5 :

find usr/ -type f -exec /usr/bin/md5sum {} >> ./DEBIAN/md5sums \;
On compresse ce qui doit l'être et on positionne les droits :

gzip --best ./DEBIAN/changelog find . -type d | xargs chmod 755 find . -type f | xargs chmod 644
On cree le package :

fakeroot dpkg-deb --build ./debian-secinst-doc-0.0.1/\ debian-secinst-doc-0.0.1.deb


Copyright (c) 2003 Simon Castro, scastro [ at ] entreelibre.com.

Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.2 or any later version published by the Free Software Foundation; with the Invariant Sections being LIST THEIR TITLES, with the Front-Cover Texts being LIST, and with the Back-Cover Texts being LIST.
You must have received a copy of the license with this document and it should be présent in the fdl.txt file.
If you did not receive this file or if you don't think this fdl.txt license is correct, have a look on the official http://www.fsf.org/licenses/fdl.txt licence file.