version française plus bas…
LPK and HPN patched OpenSSH
What is it ?
LPK patch: Ldap PubKey
This patch permits to store SSH public keys in a LDAP directory. OpenSSH daemon would look into the LDAP directory for the public key instead of using plain-text authorized_keys files.
This way, no need to copy the public key via scp or ssh-copy-id script. Everything is centralized into the LDAP directory.
That’s very efficient and usefull when using numerous computers and/or accounts.
For more informations, see the official website
Note: Distributions grumble to apply a third-party patch that is ignored upstream.
That’s the case, for example, of Debian. A few distributions and BSD flavours optionnaly apply the patch: that’s the case, for example, of Mandriva (rebuild of the package needed after tweaking the specfile).
HPN patch: High Performance SSH/SCP
This patch modify (deeply, as it seems to me), the code of the ssh server AND client in order to improve performances.
For technical informations, see the official website
Note: Distributions grumble to apply a third-party patch that is ignored upstream.
That’s the case, for example, of Debian. A few distributions and BSD flavours optionnaly apply the patch: that’s the case, for example, of Mandriva (rebuild of the package needed after tweaking the specfile), gentoo (I dunno how, SFTW) or NetBSD (see options.mk).
Howto create a Debian package of patched OpenSSH
This is the easiest way to create a Debian package of Openssh, with LPK AND HPN patches. You can also apply one of these patches only.
At the moment as I wrote these lines, OpenSSH was version 5.1p1 (portable version).
We need the two patches: LPK and HPN. They are downloadable from the projects websites.
Although, when OpenSSH 5.1 was released, the patches were not compatible. Now, they certainly are. If not, you can act as me: get patches from the OpenSSH Mandriva source RPM:
- Install rpm
- Install the source rpm (srpm)
- Get the LPK and HPN patches (from /usr/src/rpm/SOURCES)
Or get it from the official websites…
Then:
Get the Debian OpenSSH sources:
user@hostname $ apt-get source opensshIf the Debian’s OpenSSH version isn’t the good one (here, 5.1), get the official OpenSSH sources and untar the tarball
- Copy the debian/ directory from Debian’s OpenSSH sources into the stock OpenSSH source directory.
- Modify debian/changelog, to raise the version number and add comment about LPK and HPN
modify debian/rules, to add to the two lines containing “./configure”:
--with-libs="-lldap" --with-ldflags="-L/usr/lib" --with-cppflags="-I/usr/include -DWITH_LDAP_PUBKEY"Patch !
user@hostname $ patch -p1 < ../patch-lpk.diff user@hostname $ patch -p1 < ../patch-hpn.diffA few lines are rejected when applying the second patch. We just need to read servconf.c.rej and add the missing lines into the servconf.c file. That’s all !
Build the package, without signature verification (because you aren’t the Debian maintainer, so you don’t have the keys)
dpkg-buildpackage -us -uc
That’s it ! The packages are created !
If anybody is interested by precompiled binaries, here are my OpenSSH debian packages with LPK and HPN support !
OpenSSH patché LPK et HPN
Qu'est ce que sex' ?
LPK patch: LDAP PubKey
Ce patch permet de stocker les clés publiques SSH dans un annuaire LDAP. Plus exactement, il permet au serveur OpenSSH d'aller chercher la clée publique sur l'annuaire au lieu des classiques fichiers authorized_keys.
Ainsi, il n'est plus besoin de copier sa clée publique sur tous les hôte avec le script ssh-copy-id. Tout est centralisé. C'est vraiment très efficace et pratique lorsque le nombre de machines devient conséquent.
Note: Les distributions rechignent à appliquer un patch tierce-partie qui est ignoré upstream.
C'est le cas, par exemple, de Debian. Quelques distributions et flavours l'intègrent cependant optionnelement: c'est le cas par exemple de mandriva (rebuild du paquet nécessaire après configuration du specfile).
HPN patch: High performances SSH/SCP
Ce patch modifie (en profondeur j'ai l'impression) le code du serveur et du client OpenSSH afin d'améliorer les performances. Pour les infos techniques, je vous propose de visiter le site officiel
Note: Les distributions rechignent à appliquer un patch tierce-partie qui est ignoré upstream.
C'est le cas, par exemple, de Debian. Quelques distributions et flavours l'intègrent cependant optionnelement: c'est le cas par exemple de mandriva (rebuild du paquet nécessaire après configuration du specfile), de gentoo (démerdez vous, je connais pas), ou de NetBSD (voir options.mk)
Créer un paquet Debian d'OpenSSH patché LPK+HPN
Voici la méthode permettant de créer un paquet Debian d'OpenSSH patché LPK et HPN. Si vous le souhaitez, vous pouvez bien entendu activer un seul des deux patchs.
Test réalisé avec OpenSSH 5.1p1 (version portable d'OpenSSH).
Il nous faut les deux patchs, LPK et HPN. Ceux cis sont téléchargeables sur le site officiel de chaque projet. Cependant, lors de la sortie de la version 5.1 d'OpenSSH, les patchs disponibles sur ces sites n'étaient pas compatibles.
Ils sont maintenant très probablement disponibles pour la dernière version d'OpenSSH… Mais au cas où, voici la manière dont j'ai procédé:
J'ai donc récupéré les patchs dans le paquet source (SRPM) de Mandriva Linux cooker (version de developpement) (note: actuelle 2009.0):
- installation de rpm
- installation du srpm
- récupération des patchs LPK et HPN (dans /usr/src/rpm/SOURCES)
Ou récupérez les patchs sur les sites officiels des projets
- récupération des sources du paquet officiel debian:
user@hostname $ apt-get source openssh - récupération et décompression des sources d'openssh 5.1p1
- copie du dossier debian/ des sources du paquet debian dans le dossier des sources de la version 5.1p1
- modification du debian/changelog, afin de mettre à jour la version du paquet + infos sur LPK et HPN
modification du debian/rules, afin d'ajouter aux deux lignes contenant “./configure”:
--with-libs="-lldap" --with-ldflags="-L/usr/lib" --with-cppflags="-I/usr/include -DWITH_LDAP_PUBKEY"patchons !
user@hostname $ patch -p1 < ../patch-lpk.diff user@hostname $ patch -p1 < ../patch-hpn.diff
Au deuxième patch, quelques lignes sont rejetés. Il suffit de lire de servconf.c.rej et d'ajouter les lignes manquantes dans le fichier servconf.c, tout simplement.
7. création du paquet, sans vérification de signatures:
dpkg-buildpackage -us -uc
Et voilà, les paquets client et serveur d'OpenSSH sont créés.
Pour les éventuels intéréssés par ces paquets: ils sont ici