http://www.e-glop.net/w/index.php?title=Permettre_une_authentification_unifi%C3%A9e_pour_SMTP,_POP/IMAP_et_FTP&feed=atom&action=history
Permettre une authentification unifiée pour SMTP, POP/IMAP et FTP - Historique des versions
2024-03-28T18:54:06Z
Historique des versions pour cette page sur le wiki
MediaWiki 1.29.1
http://www.e-glop.net/w/index.php?title=Permettre_une_authentification_unifi%C3%A9e_pour_SMTP,_POP/IMAP_et_FTP&diff=2378&oldid=prev
BeTa : /* vsftpd */
2013-01-09T10:47:23Z
<p><span dir="auto"><span class="autocomment">vsftpd</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='fr'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Version précédente</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Version du 9 janvier 2013 à 10:47</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l75" >Ligne 75 :</td>
<td colspan="2" class="diff-lineno">Ligne 75 :</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Attention à ce que le guest_username corresponde à un utilisateur réel de votre système, créé spécialement pour cet usage. Ça sera l'utilisateur réel commun à tous vos utilisateurs virtuels.</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Attention à ce que le guest_username corresponde à un utilisateur réel de votre système, créé spécialement pour cet usage. Ça sera l'utilisateur réel commun à tous vos utilisateurs virtuels.</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">==== Bug possible sur le chroot des utilisateurs virtuels ====</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Il est possible, depuis les dernières version 2.x de vsftpd que vous obteniez le message suivant lors d'une tentative de connection :</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> 500 OOPS: vsftpd: refusing to run with writable root inside chroot()</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Cela est en lien avec l'option '''chroot_local_user=YES'''. Pour contourner ce problème, tout en laissant les répertoires de vos utilisateurs accessibles en écriture, il est nécessaire d'ajouter l'option :</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> allow_writeable_chroot=YES</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> #allow_writable_chroot=YES # pour vsftpd-ext</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">Cependant, ce n'est pas tout. Pour certaines version 2.x de vsftpd (au moins la 2.3.5 fournie avec la Debian Wheezy à l'heure où ces lignes sont écrites) cette option est non supportée. Ainsi la seule solution trouvée, afin de conserver un comportement conforme à vos attentes, a été d'installer une version 3.x issue de Debian SID. Pour ce faire, nous sommes aller voir [http://packages.debian.org/search?keywords=vsftpd|les packages de Debian], puis nous avons téléchargé la version 3.x de notre architecture et la plus proche de notre distribution Debian (ici [http://packages.debian.org/sid/vsftpd|la version 3.0.2 issue de la Debian SID]) pour l'installer finalement "à la main" :</ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"> $ sudo dpkg -i vsftpd_3.0.2-1_amd64.deb</ins></div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>=== Limites ===</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>=== Limites ===</div></td></tr>
</table>
BeTa
http://www.e-glop.net/w/index.php?title=Permettre_une_authentification_unifi%C3%A9e_pour_SMTP,_POP/IMAP_et_FTP&diff=2251&oldid=prev
BeTa : /* /etc/cron.hourly/create-ftp-dirs.php */
2010-07-08T14:36:21Z
<p><span dir="auto"><span class="autocomment">/etc/cron.hourly/create-ftp-dirs.php</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='fr'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Version précédente</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Version du 8 juillet 2010 à 14:36</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l101" >Ligne 101 :</td>
<td colspan="2" class="diff-lineno">Ligne 101 :</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  #!/usr/bin/php</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  #!/usr/bin/php</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  <?php</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  <?php</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>   define('HOST','<del class="diffchange diffchange-inline">localhost</del>');</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>   define('HOST','');</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>   define('DB','<del class="diffchange diffchange-inline">postfix</del>');</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>   define('DB','');</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>   define('USER','<del class="diffchange diffchange-inline">postfix</del>');</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>   define('USER','');</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>   define('PASSWD','<del class="diffchange diffchange-inline">z6*SDozZ0W</del>');</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>   define('PASSWD','');</div></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>   define('FTPROOT','<del class="diffchange diffchange-inline">/ftp</del>');</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>   define('FTPROOT','');</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>    </div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>    </div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>   $conn = pg_connect('host='.HOST.' dbname='.DB.' user='.USER.' password='.PASSWD);</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>   $conn = pg_connect('host='.HOST.' dbname='.DB.' user='.USER.' password='.PASSWD);</div></td></tr>
</table>
BeTa
http://www.e-glop.net/w/index.php?title=Permettre_une_authentification_unifi%C3%A9e_pour_SMTP,_POP/IMAP_et_FTP&diff=2250&oldid=prev
BeTa : /* PAM */
2010-07-08T14:34:57Z
<p><span dir="auto"><span class="autocomment">PAM</span></span></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='fr'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Version précédente</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Version du 8 juillet 2010 à 14:34</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l42" >Ligne 42 :</td>
<td colspan="2" class="diff-lineno">Ligne 42 :</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  account required pam_pgsql.so config_file=/etc/pam.d/vsftpd.pgsql.conf</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  account required pam_pgsql.so config_file=/etc/pam.d/vsftpd.pgsql.conf</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>Afin que l'authentification se fasse correctement, il faut faire connaître à PAM [[Paramétrer un serveur mail Postfix, Courier-IMAP avec authentification PostgreSQL et <del class="diffchange diffchange-inline">SAS</del>|le schéma vu précédemment]] :</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>Afin que l'authentification se fasse correctement, il faut faire connaître à PAM [[Paramétrer un serveur mail Postfix, Courier-IMAP avec authentification PostgreSQL et <ins class="diffchange diffchange-inline">SASL</ins>|le schéma vu précédemment]] :</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  $ sudo vi /etc/pam.d/vsftpd.pgsql.conf</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>  $ sudo vi /etc/pam.d/vsftpd.pgsql.conf</div></td></tr>
</table>
BeTa
http://www.e-glop.net/w/index.php?title=Permettre_une_authentification_unifi%C3%A9e_pour_SMTP,_POP/IMAP_et_FTP&diff=2248&oldid=prev
BeTa le 8 juillet 2010 à 11:37
2010-07-08T11:37:49Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='fr'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Version précédente</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Version du 8 juillet 2010 à 11:37</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l130" >Ligne 130 :</td>
<td colspan="2" class="diff-lineno">Ligne 130 :</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Créez un nouveau compte email, vérifiez qu'il peut bien recevoir des courriels. Vérifiez également, après avoir attendu une heure que le dossier soit créé, qu'il accède bien au service FTP... CQFD !</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Créez un nouveau compte email, vérifiez qu'il peut bien recevoir des courriels. Vérifiez également, après avoir attendu une heure que le dossier soit créé, qu'il accède bien au service FTP... CQFD !</div></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'>−</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;"><div>[[Catégorie:Informatique]][[Debian GNU/Linux]]</div></td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div>[[Catégorie:Informatique]] [[<ins class="diffchange diffchange-inline">Catégorie:</ins>Debian GNU/Linux]]</div></td></tr>
</table>
BeTa
http://www.e-glop.net/w/index.php?title=Permettre_une_authentification_unifi%C3%A9e_pour_SMTP,_POP/IMAP_et_FTP&diff=2247&oldid=prev
BeTa le 8 juillet 2010 à 11:37
2010-07-08T11:37:01Z
<p></p>
<table class="diff diff-contentalign-left" data-mw="interface">
<col class='diff-marker' />
<col class='diff-content' />
<col class='diff-marker' />
<col class='diff-content' />
<tr style='vertical-align: top;' lang='fr'>
<td colspan='2' style="background-color: white; color:black; text-align: center;">← Version précédente</td>
<td colspan='2' style="background-color: white; color:black; text-align: center;">Version du 8 juillet 2010 à 11:37</td>
</tr><tr><td colspan="2" class="diff-lineno" id="mw-diff-left-l129" >Ligne 129 :</td>
<td colspan="2" class="diff-lineno">Ligne 129 :</td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"></td></tr>
<tr><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Créez un nouveau compte email, vérifiez qu'il peut bien recevoir des courriels. Vérifiez également, après avoir attendu une heure que le dossier soit créé, qu'il accède bien au service FTP... CQFD !</div></td><td class='diff-marker'> </td><td style="background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;"><div>Créez un nouveau compte email, vérifiez qu'il peut bien recevoir des courriels. Vérifiez également, après avoir attendu une heure que le dossier soit créé, qu'il accède bien au service FTP... CQFD !</div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;"></ins></div></td></tr>
<tr><td colspan="2"> </td><td class='diff-marker'>+</td><td style="color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;"><div><ins style="font-weight: bold; text-decoration: none;">[[Catégorie:Informatique]][[Debian GNU/Linux]]</ins></div></td></tr>
</table>
BeTa
http://www.e-glop.net/w/index.php?title=Permettre_une_authentification_unifi%C3%A9e_pour_SMTP,_POP/IMAP_et_FTP&diff=2246&oldid=prev
BeTa le 8 juillet 2010 à 11:36
2010-07-08T11:36:23Z
<p></p>
<p><b>Nouvelle page</b></p><div>== Introduction ==<br />
<br />
=== Objectif ===<br />
<br />
Avoir une authentification unifiée entre services FTP, IMAP, POP3 et SMTP.<br />
<br />
=== Notes ===<br />
<br />
Ici il s'agira d'un "backend" PostgreSQL. L'équivalent est tout à fait imaginable pour MySQL bien entendu, à quelques détails près.<br />
<br />
Cette solution permet, dans un second temps, de mettre en place une interface unifiée de gestion de ses comptes. Ainsi en deux clics, il sera possible de créer un compte courriel et son compte FTP associé et que tout soit mis en place très rapidement.<br />
<br />
=== Pré-requis ===<br />
<br />
Vous aurez sans doute besoin de prendre connaissance de la première partie de cette documentation : [[Paramétrer un serveur mail Postfix, Courier-IMAP avec authentification PostgreSQL et SASL]]<br />
<br />
Les commandes proposées sont parfois directement liées aux infrastructures basées sur les distributions Debian (Ubuntu par exemple).<br />
<br />
== Mise en œuvre de l'authentification unifiée ==<br />
<br />
=== Besoins et débouchés ===<br />
<br />
Nous avons tout notre système de messagerie qui fonctionne déjà sur une authentification via PostgreSQL. Nous souhaitons donc appuyer l'authentification des utilisateurs virtuels de vsftpd sur ce même mécanisme.<br />
<br />
Afin de permettre l'authentification sur PostgreSQL de vsftpd, il faut passer par pam-pgsql. Installons donc ce module de PAM si ce n'est déjà fait :<br />
<br />
sudo apt-get install libpam-pgsql<br />
<br />
=== PAM ===<br />
<br />
il est nécessaire de configurer PAM pour se connecter à PostgreSQL :<br />
<br />
$ sudo vi /etc/pam.d/vsftpd<br />
<br />
# Standard behaviour for ftpd(8).<br />
auth required pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed<br />
<br />
# Note: vsftpd handles anonymous logins on its own. Do not enable<br />
# pam_ftp.so.<br />
<br />
auth required pam_pgsql.so config_file=/etc/pam.d/vsftpd.pgsql.conf<br />
account required pam_pgsql.so config_file=/etc/pam.d/vsftpd.pgsql.conf<br />
<br />
Afin que l'authentification se fasse correctement, il faut faire connaître à PAM [[Paramétrer un serveur mail Postfix, Courier-IMAP avec authentification PostgreSQL et SAS|le schéma vu précédemment]] :<br />
<br />
$ sudo vi /etc/pam.d/vsftpd.pgsql.conf<br />
<br />
debug<br />
pw_type = md5<br />
connect = hostaddr=HOST port=5432 dbname=DB user=USER password=PASSWORD connect_timeout=15<br />
auth_query = select substring(password from 9) from mailbox where username = %u<br />
acct_query = select NOT active AS acc_expired, 0 AS acc_new_pwreq, (password ISNULL OR password = '') as user_password from mailbox where username = %u<br />
<br />
Vous noterez 3 points importants :<br />
* n'oubliez pas d'entrer vos paramètres pour permettre à PAM de se connecter à votre base de données<br />
* le mot de passe est en clair (cf. ci-après)<br />
* la requête spécifiée pour récupérer le mot de passe en base de données a été sensiblement adaptée par "substring(password from 9)" car vfstpd ne comprend pas le préfixe nécessaire à Postfix {MD5RAW}, que nous retirons donc artificiellement via ce hack.<br />
<br />
afin d'éviter toute fuite d'information, nous ne pouvons que vous recommander de changer les droits du dernier fichier créé :<br />
<br />
$ sudo chmod 640 /etc/pam.d/vsftpd.pgsql.conf<br />
<br />
=== vsftpd ===<br />
<br />
Enfin, pour ne pas que vsftpd fasse de correspondance entre nos utilisateurs virtuels et nos utilisateurs réels, nous allons le paramétrer en ce sens en rajoutant à votre configuration personnalisée :<br />
<br />
$ sudo vi /etc/vsftpd.conf<br />
<br />
# ajouter ces lignes dans le fichier de configuration<br />
guest_enable=YES<br />
guest_username=ftpsecure<br />
user_sub_token=$USER<br />
local_root=/ftp/$USER<br />
EOF<br />
<br />
Attention à ce que le guest_username corresponde à un utilisateur réel de votre système, créé spécialement pour cet usage. Ça sera l'utilisateur réel commun à tous vos utilisateurs virtuels.<br />
<br />
=== Limites ===<br />
<br />
Dès maintenant, tous vos comptes courriels deviennent également des comptes FTP. Cependant, cela revêt 3 grandes limites :<br />
* Les mots de passe passent en clair via FTP, alors qu'ils sont peut-être déjà sécurisés via vos solutions courriels... pensez donc à rajouter les fonctionnalités de cryptage à vsftpd ("FTPS", FTP over SSL)<br />
* Tous les comptes courriels ont leur équivalent FTP... on peut donc imaginer rajouter un boolean dans la table mailbox pour définir si un compte est actif pour l'accès FTP ou non (ajout d'une colonne pour se faire)<br />
* Lors de la création d'un nouveau compte courriel/FTP, le répertoire de stockage des emails est créé automatiquement mais pas le répertoire FTP... il faut donc soit l'automatiser de manière externe à vsftpd qui n'a pas cette fonctionnalité, soit le faire "à la main".<br />
<br />
== Automatiser la création des répertoires FTP des nouveaux comptes ==<br />
<br />
La meilleure solution que nous avons vu pour le moment est de passer par une tâche "cron" (le plannificateur des tâches). Nous avons choisi une tâche exécutée en PHP car c'est déjà le langage utilisé par notre "backend" de gestion qui est sous Symfony. Voici donc la solution déployée sur nos serveurs :<br />
<br />
=== pré-requis ===<br />
<br />
Il faut déjà installer php5-cli sur le serveur :<br />
<br />
$ sudo apt-get intall php5-cli<br />
<br />
=== /etc/cron.hourly/create-ftp-dirs.php ===<br />
<br />
Voici donc le script utilisé, placé dans un répertoire contenant les scripts à lancer toutes les heures :<br />
<br />
$ sudo vi /etc/cron.d/create-ftp-dirs.php<br />
<br />
#!/usr/bin/php<br />
<?php<br />
define('HOST','localhost');<br />
define('DB','postfix');<br />
define('USER','postfix');<br />
define('PASSWD','z6*SDozZ0W');<br />
define('FTPROOT','/ftp');<br />
<br />
$conn = pg_connect('host='.HOST.' dbname='.DB.' user='.USER.' password='.PASSWD);<br />
$q = pg_query("SELECT username FROM mailbox");<br />
while ( $row = pg_fetch_row($q) )<br />
if ( !file_exists(FTPROOT.'/'.$row[0]) )<br />
{<br />
mkdir(FTPROOT.'/'.$row[0]);<br />
chown(FTPROOT.'/'.$row[0],'ftpsecure');<br />
chgrp(FTPROOT.'/'.$row[0],'ftpsecure');<br />
}<br />
pg_free_result($q);<br />
?><br />
<br />
=== Sécurisons les informations ===<br />
<br />
Les identifiants pour se connecter à la base de données sont accessibles depuis ce script, veillez donc à ce que seul l'utilisateur root puisse y accéder :<br />
<br />
$ sudo chown root:root /etc/cron.hourly<br />
$ sudo chmod 700 /etc/cron.hourly<br />
<br />
== Conclusion ==<br />
<br />
Créez un nouveau compte email, vérifiez qu'il peut bien recevoir des courriels. Vérifiez également, après avoir attendu une heure que le dossier soit créé, qu'il accède bien au service FTP... CQFD !</div>
BeTa