" #
$ %& %' (
)* * + * * ,*
- % .
)* * + * * ,*
!"
# "$ "
% &
' & #
. /" 0
. $$ " $ 1 0
.# !" "%$ $ ")
01/12 ,* % 3 4* ,5 - &11111111111111111111111111111111111111111111111111111111111111
01/1212 ,* %$36 * *%41 611111111111111111111111111111111111111111111111111111111111111111
01/121 * *%41 6 % ,5 - + 11111111111111111111111111111111111111111111 /
01/1 ,* % 3 4* ,3 7 111111111111111111111111111111111111111111111111111111111111 8
. % 2" $ ") '
- / % .
)* * + * * ,*
1 INTRODUCTION
- 8 % .
)* * + * * ,*
2 DESCRIPTION DE L’INSTALLATION
;%* * 5 :% ** * $ 3 6 ;* % )% 5 %7 '
,5%+ *% )% ) 3 3+ * @ *3+ * %71
% ,+ * 5 :% ** % %*+ * 5 36 1
• 5 36 ) % + %7 44 +, = '
• 5 36 3+ * @ 44 +, =
• 5 36 3+ * %7E ; F 44 +, =
3 + 4+ + 5 :% ** &
PDC-SAMBA
GNU/Linux 2.6
Debian Sarge 3.1
192.168.0.254 192.168.1.254
192.168.0.100 192.168.1.100
192.168.0.0/24 192.168.1.0/24
- 0 % .
)* * + * * ,*
3 ROUTAGE
% 4 %) *3 3* %7 , %7+-:% $$, * ) 3% %+ * $3
, % +$%*:% 3 ** * $3 *3 3*, > %7 , %71
• $$3* %7 >+ 3 * , %1
• 3*) * % %*- 1
PDC-SAMBA:~# vi /etc/network/interfaces
auto lo
iface lo inet loopback
#interface monte automatiquement au démarrage du système
auto eth0
iface eth0 inet static
address 192.168.0.254
netmask 255.255.255.0
network 192.168.0.0
broadcast 192.168.0.255
#gateway 192.168.0.1
dns-nameservers 212.27.54.252
- G % .
)* * + * * ,*
PDC-SAMBA:~# route
Table de routage IP du noyau
Destination Passerelle Genmask Indic Metric Ref Use Iface
192.168.0.0 * 255.255.255.0 U 0 0 0 eth0
192.168.254.0 * 255.255.255.0 U 0 0 0 eth0
- J % .
)* * + * * ,*
4 CONTRÔLEUR DE DOMAINE
4.1 Préparation de samba
%* <; ) 3, ,4 * &
,4 * L * *3M, + 4 $+ * , * &
PDC-SAMBA:~# mkdir /var/samba/profiles
,4 * L * *3M, + 3 4* ,5 - &
PDC-SAMBA:~# mkdir /var/samba/netlogon
,4 * ) *>+ 3 &
PDC-SAMBA:~# mkdir /home/samba
PDC-SAMBA:~# mkdir /home/samba/dfs
PDC-SAMBA:~# vi /etc/samba/smb.conf
3 + 3 * % %$36 &
# Global parameters
#================= Global Settings ===================
[global]
#nom du domaine si le serveur est configuré en tant que PDC
workgroup = cnam
#nom du serveur
netbios name =PDC-SAMBA
#configure le serveur SAMBA en tant que PDC
domain master =yes
- . % .
)* * + * * ,*
[profiles]
comment = Homes windows
path = /var/samba/profiles
browseable = No
read only = No
[homes]
comment = Répertoires personnels
path = /home/%U
browseable = No
read only = No
[commun]
comment = Répertoire commun
- 2 % .
)* * + * * ,*
path = /commun
browseable = yes
writable = yes
guest ok = yes
% ++ 4 , *3 , + 3 54* N- %4 %*+ *% % 5 E 5; F
1
!"
,* <% - %4 & #
PDC-SAMBA:~# groupadd pc
- 22 % .
)* * + * * ,*
[dfs]
comment = Partage DFS
path = /home/samba/dfs
msdfs root = yes
- 2 % .
)* * + * * ,*
, % 3 4* *+ 4+3 % %&
#!/bin/sh
DATE=`date +%b%d-%H%M%S`
OUTDIR=/commun
ps2pdf $1 $OUTDIR/$DATE.temp
mv $OUTDIR/$DATE.temp $OUTDIR/$DATE.pdf
rm $1
+ 3 4* 7,3%*;+
PDC-SAMBA:~# chmod +x /usr/bin/printpdf
[pdf]
path = /tmp
printable = yes
guest ok = yes
print command = /usr/bin/printpdf %s %U
- 2/ % .
)* * + * * ,*
5 CLIENT WINDOWS
% *,- % 3+ * @ + 5 +$%* < % :% 3 +%=3 *
% ) 4 $ ++1 ) $5 + + 4 5 *4 <C* 3+ * <%
5 1
- 28 % .
)* * + * * ,*
- 2A % .
)* * + * * ,*
+:% ) 3 + ; %* * + % % +<3? H * * ) +I 4%
,+3* 4 4 ,*, &
- 20 % .
)* * + * * ,*
** >4 , *+ 3 54* * 5; :% * 5 * *% % 5
- 2G % .
)* * + * * ,*
6 CLIENT LINUX
6.1 Prérequis
% 4 %) D 3+ * + %7 % 5 *%*+ + 3 54* % 5
' E F +$%*%*+ ! "
- 2J % .
)* * + * * ,*
) % % *"
# /etc/nsswitch.conf
#
# Example configuration of GNU Name Service Switch functionality.
# If you have the `glibc-doc' and `info' packages installed, try:
# `info libc "Name Service Switch"' for information about this file.
protocols: db files
services: db files
ethers: db files
rpc: db files
netgroup: nis
) % % &% &"
[global]
workgroup = CNAM
server string = %h server (Samba %v)
netbios name = client-linux1
security = domain
#wins support = no
wins server = 192.168.1.254
dns proxy = no
#name resolve order = wins lmhost host bcast
log file = /var/log/samba/log.%m
max log size = 1000
#syslog only = no
syslog = 0
panic action = /usr/share/samba/panic-action %d
- 2. % .
)* * + * * ,*
+ , ' -
+ $%*3 55 3 4 C* + ) % 5; *@ ; &
CLIENT-LINUX:~# /etc/init.d/samba stop
CLIENT-LINUX:~# /etc/init.d/winbind stop
%* + $%*,) 55 * * + 5 * 4 *% 5 5; 1
,5 5; *@ ; &
CLIENT-LINUX:~# /etc/init.d/samba start
CLIENT-LINUX:~# /etc/init.d/winbind start
$$36 + + * - %4 % 5 &
CLIENT-LINUX:~# wbinfo –g
- % .
)* * + * * ,*
LINUX:~# /etc/pam.d/common-account
LINUX:~# /etc/pam.d/common-auth
LINUX:~# /etc/pam.d/common-session
/ * ,
#
# /etc/pam.d/common-account - authorization settings common to all
services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authorization modules that define
# the central access policy for use on the system. The default is to
# only deny service to users whose accounts are expired in /etc/shadow.
#
account sufficient pam_winbind.so
account sufficient pam_unix.so
/ * , *
#
# /etc/pam.d/common-auth - authentication settings common to all
services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of the authentication modules that define
# the central authentication scheme for use on the system
# (e.g., /etc/shadow, LDAP, Kerberos, etc.). The default is to use the
# traditional Unix authentication mechanisms.
#
auth sufficient pam_winbind.so
auth required pam_unix.so use_first_pass
#auth required pam_unix.so
- 2% .
)* * + * * ,*
/ * ,
#
# /etc/pam.d/common-session - session-related modules common to all
services
#
# This file is included from other service-specific PAM config files,
# and should contain a list of modules that define tasks to be
performed
# at the start and end of sessions of *any* kind (both interactive and
# non-interactive). The default is pam_unix.
#
session required pam_unix.so
session optional pam_mkhomedir.so
4 %*>4 * 3 3* 5 3 + 4% + 3+ *+ %7 ) 3% %*+ *%
% 5 1
% 4 %) 5 44 :% , % % + %7 $ * 5C5 :% %
@ @1 *&
= 3, % 3 4* ,5 - 4 5 ** *+ + 3 + ,-+ - %*+ *% E5 *-
4 *-, * %* 3* ,3 F
= 3, % 3 4* ,3 7 4 5 ** * * %* ,5 * +
4 *-, 1
. " %3 " 3
+ $%* 3 4 + $5 * %) * % , *% *7* 4% -* +
$36 N *3N * *%41 6E+ 5 *+ + 3 * %$36 < *4 < 54 * 3 5 +
$%* < % :% +<%*+ *% 4 % +< 7,3%* F1
#!/bin/bash
#script de démarrage de sessions
- % .
)* * + * * ,*
if [ ! -d $HOME/rep_perso ];
then mkdir $HOME/rep_perso
fi
if [ ! -e $HOME/Desktop/rep_perso ];
then
ln $HOME/rep_perso --target-directory=$HOME/Desktop --symbolic
fi
user2=$USER
if [ `expr match "$USER" 'CNAM/'` -gt 0 ];
then user2=${USER#CNAM/}
fi
$ + $36 - *, %) % * 5 + * *4 + 3 55 %) *
4% + $36 7,3%*;+ & chmod +x /etc/startup.sh1
. " 3 " ! $
36 :% 4 $+ %*+ *% *3M, N6 5 NR % 4 %) ) +
$36 1; 6 3 1; 6 4 $+ 1; 6 + - %* *1- 5 3
3 4* $36 &
- /% .
)* * + * * ,*
% ++ 34 ,4 * ,5 - 1 % 3 + + $%*, *
1- 5 3E %+ 3, < + < 7 * 4 F *B 3 4 + 3 * % %) *&
&
* 4 ;+ *, 3 55 +<%*+ * M ; + 3 55 5 %* %
+<%*+ * 4 5 ** * % %*6 *$3 * % :% +<%*+ *% 1 3
,)* * + *4 % 5 * 4 % * 5 +1 + %$$ * 4 3, +
$36 1- 5 3 * *4 + 3 55 6 N *3N * *%41 6 + $36 1; 6 3 %
1; 6 4 $+ 1 +6 % % 5 * % < ) 4 4% ,*% 3 4 *4 5 :%
*54 1
#.bash_logout
#Script de déconnexion
#démonte le répertoire personnel de l’utilisateur
smbumount $HOME/rep_perso
#supprime le repertoire de montage
rm –r $HOME/rep_perso
#supprime le raccourci vers le repertoire de montage
rm $HOME/Desktop/rep_perso
4 1
- 8% .
)* * + * * ,*
4 9 + ,5 - + %7 ) % 1 $ C* 4 5 * % *$
) 3% + - *% 4 @ 1 % < %*6 *$ %+ 5 + $%*3 54+,*
3 55 3= %&
- & N
@ &
3 ** + + ,5 - 5 ) 3% * 5 + 5 *% 5 *
4 1 , + *,+ 5 * 4 5 , *3 +% 4 5 ** * 5 * % ,4 *
4 *-, % + %7E,:%) + * <% :% , % % @ @ F1 + $%* 3*4 +
5C5 5 * 4 :%< % ,5 - + 1
3 + $ C* L) % ) K*4 ) * 5 * 4 &
- A% .
)* * + * * ,*
- 0% .
)* * + * * ,*
% 4 %) K + %) + 33 % 3 4 4 :% 4 *) + :% , %
4 + &
- G% .
)* * + * * ,*
- J% .
)* * + * * ,*
7 CONCLUSION
<,*% $$3*%, % 4 5 * ) ++ % % ) 5 * B *95
< 74+ ** 5 7* 1 4% 5 * :% @ @ *+ %7 4 %) *3 6 ;* %
) % +<%*+ * <% 5 4 5 ** * + + ; *, %7 %*+ *% < )
3 * 5 36 $$, * < %* 4 % 44+ 3 * ; 4 ,3 1 4% 4
7 54+ 3 *% % 5 ) 3&
= 3+ * @ @ 4% + )3 %*+ * 44+ 3 * $ 3* *:%
%@ @ E7& %*3 F
= 3+ * + %7 4 % %*+ *% * E3 + 4 5 * 5 % + 3 S*
+3 3 F
= 3+ * 5 3 * 6 4% 4 $ * %- 46 5 1
3 ** :% +< 5 * *% % , % 3 ) + ; *, 36 7
34 * %4 7 <% % 3 S* *54 S>% 4 36,*, -9 1
- .% .