Projet

Général

Profil

Multiftp » Historique » Version 2

Gaston TJEBBES, 08/07/2010 11:19

1 1 Gaston TJEBBES
h1. Utilisation de plusieurs ftp Scribe en mode CAS :
2 1 Gaston TJEBBES
3 1 Gaston TJEBBES
Ceci est un exemple d'application, d'autres solutions existent.
4 1 Gaston TJEBBES
5 1 Gaston TJEBBES
6 1 Gaston TJEBBES
h2. Prérequis
7 1 Gaston TJEBBES
8 1 Gaston TJEBBES
Deux serveurs Scribe (scribe1 et scribe2) , avec un serveur au moins ayant l'authentification CAS activée (scribe1 par exemple).
9 1 Gaston TJEBBES
10 1 Gaston TJEBBES
!!! Les comptes des deux serveurs doivent être identique pour permettre le rapprochement.
11 1 Gaston TJEBBES
Si le ftp de scribe2 cherche l'authentification sur scribe1 :
12 1 Gaston TJEBBES
* Il récupère le login de l'utilisateur (admin par exemple);
13 1 Gaston TJEBBES
* Il tente de se connecter en local sur /home/a/admin/.ftp. 
14 1 Gaston TJEBBES
15 1 Gaston TJEBBES
scribe2 doit avoir le droit d'effectuer des requêtes https vers scribe1.
16 1 Gaston TJEBBES
17 1 Gaston TJEBBES
18 1 Gaston TJEBBES
h2. Configurer l'authentification
19 1 Gaston TJEBBES
20 1 Gaston TJEBBES
Sur le serveur Scribe2, il faut indiquer au serveur ftp de Scribe2 qu'il doit vérifier ses tickets sur le serveur Scribe1.
21 1 Gaston TJEBBES
22 1 Gaston TJEBBES
h3. Certificats
23 1 Gaston TJEBBES
24 1 Gaston TJEBBES
Dans le cas de certificat auto-signé, il faut récupérer la CA utilisé par le serveur CAS de Scribe1 et la placer sur Scribe2 afin que celui-ci puisse contacter le serveur en question.
25 1 Gaston TJEBBES
Sur le serveur Scribe2 : 
26 1 Gaston TJEBBES
scp root@scribe1:/etc/ssl/certs/ca.crt /etc/ssl/certs/ca_scribe1.crt
27 1 Gaston TJEBBES
28 1 Gaston TJEBBES
h3. La configuration pam_cas
29 1 Gaston TJEBBES
30 1 Gaston TJEBBES
Rajoutons la configuration pour la validation CAS auprès de Scribe1:
31 1 Gaston TJEBBES
vi /etc/pam_cas_scribe1.conf 
32 1 Gaston TJEBBES
et rentrez ceci :
33 1 Gaston TJEBBES
<pre>
34 1 Gaston TJEBBES
# Le nom de domaine pour accéder au serveur CAS de scribe1
35 1 Gaston TJEBBES
host scribe1.academie.fr
36 1 Gaston TJEBBES
# Le port d'accès
37 1 Gaston TJEBBES
port 8443
38 1 Gaston TJEBBES
# L'url auprès de laquelle valider les tickets
39 1 Gaston TJEBBES
uriValidate /proxyValidate
40 1 Gaston TJEBBES
# Les serveurs CAS eole fonctionnent en https
41 1 Gaston TJEBBES
ssl on
42 1 Gaston TJEBBES
# Le debug s'effectue dans syslog
43 1 Gaston TJEBBES
debug off
44 1 Gaston TJEBBES
# le chemin vers la CA du serveur CAS de scribe1
45 1 Gaston TJEBBES
trusted_ca /etc/ssl/certs/ca_scribe1.crt
46 1 Gaston TJEBBES
</pre>
47 1 Gaston TJEBBES
48 1 Gaston TJEBBES
h3. La configuration proftpd
49 1 Gaston TJEBBES
50 1 Gaston TJEBBES
Configurons le chargement des modules pam qui vont permettre l'authentification CAS auprès du serveur Scribe1.
51 1 Gaston TJEBBES
52 1 Gaston TJEBBES
Dans le fichier /etc/pam.d/proftpd, nous allons rajouter la configuration que nous avons créer pour avoir le résultat suivant :
53 1 Gaston TJEBBES
<pre>
54 1 Gaston TJEBBES
#%PAM-1.0
55 1 Gaston TJEBBES
auth sufficient /lib/security/pam_cas.so -sftp://ipscribe2 -f/etc/pam_cas_scribe1.conf
56 1 Gaston TJEBBES
## auth sufficient       pam_listfile.so item=user sense=deny file=/etc/ftpusers onerr=succeed
57 1 Gaston TJEBBES
auth     sufficient      /lib/security/pam_ldap.so
58 1 Gaston TJEBBES
@include login
59 1 Gaston TJEBBES
</pre>
60 1 Gaston TJEBBES
61 1 Gaston TJEBBES
Ainsi, lorsque proftpd récupère un login/mot de passe pour la connexion au serveur ftp de scribe2, il va le vérifier auprès du serveur scribe1.
62 1 Gaston TJEBBES
63 1 Gaston TJEBBES
h2. Ajaxplorer
64 1 Gaston TJEBBES
65 1 Gaston TJEBBES
Dans ajaxplorer sur le serveur Scribe1, en admin :
66 1 Gaston TJEBBES
67 2 Gaston TJEBBES
* Aller dans le menu déroulant en haut à gauche;
68 2 Gaston TJEBBES
* Choisir "Settings";
69 2 Gaston TJEBBES
* Dans repositories, cliquer sur "Nouveau Repo";
70 2 Gaston TJEBBES
* Entrez un libellé;
71 2 Gaston TJEBBES
* Choisir le plugin "FTP Server Cas";
72 2 Gaston TJEBBES
* Entrez l'ip de votre serveur Scribe2;
73 2 Gaston TJEBBES
* Dans Encoding mettre "utf-8";
74 2 Gaston TJEBBES
* Valider;
75 2 Gaston TJEBBES
* Tout nouvel utilisateur aura accès au serveur scribe2 (si il a un compte dessus, si il n'en a pas, une erreur subviendra).