Contenu | Rechercher | Menus

Annonce

Si vous avez des soucis pour rester connecté, déconnectez-vous puis reconnectez-vous depuis ce lien en cochant la case
Me connecter automatiquement lors de mes prochaines visites.

À propos de l'équipe du forum.

#1 Le 20/01/2015, à 15:27

eric-bsm

[RESOLU] accès à un dossier en utilisant l'authentification Windows

bonjour à tous,

J'ai installé un serveur Ubuntu 14.04 LTS dans mon entreprise. Je l'ai intégré à mon domaine Active Directory 2008 en passant par cette méthode : http://www.kiloroot.com/add-ubuntu-14-0 … tegration/

La commande getent group me retourne bien tous mes groupes globaux définis dans l'AD,

Mon fichier smb.conf est le suivant:

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
#   workgroup = WORKGROUP
 workgroup = dreal-lor

# server string is the equivalent of the NT Description field
        server string = %h server (Samba, Ubuntu)

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
#   wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
;   wins server = w.x.y.z

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no
log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
   max log size = 1000
####### Authentication #######

# Server role. Defines in which mode Samba will operate. Possible
# values are "standalone server", "member server", "classic primary
# domain controller", "classic backup domain controller", "active
# directory domain controller".
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   server role = standalone server

# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
   passdb backend = tdbsam
#############################
   obey pam restrictions = yes
# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user
########## Domains ###########

#
# The following settings only takes effect if 'server role = primary
# classic domain controller', 'server role = backup domain controller'
# or 'domain logons' is set
#

# It specifies the location of the user's
# profile directory from the client point of view) The following
# required a [profiles] share to be setup on the samba server (see
# below)
;   logon path = \\%N\profiles\%U
# Another common choice is storing the profile in the user's home directory
# (this is Samba's default)
#   logon path = \\%N\%U\profile

# The following setting only takes effect if 'domain logons' is set
# It specifies the location of a user's home directory (from the client
# point of view)
;   logon drive = H:
#   logon home = \\%N\%U

# The following setting only takes effect if 'domain logons' is set
# It specifies the script to run during logon. The script must be stored
# in the [netlogon] share
# NOTE: Must be store in 'DOS' file format convention
;   logon script = logon.cmd

# This allows Unix users to be created on the domain controller via the SAMR
# RPC pipe.  The example command creates a user account with a disabled Unix
# password; please adapt to your needs
; add user script = /usr/sbin/adduser --quiet --disabled-password --gecos "" %u

# This allows machine accounts to be created on the domain controller via the
# SAMR RPC pipe.
# The following assumes a "machines" group exists on the system
; add machine script  = /usr/sbin/useradd -g machines -c "%u machine account" -d /var/lib/samba -s /bin/false %u
# This allows Unix groups to be created on the domain controller via the SAMR
# RPC pipe.
; add group script = /usr/sbin/addgroup --force-badname %g

############ Misc ############

# Using the following line enables you to customise your configuration
# on a per machine basis. The %m gets replaced with the netbios name
# of the machine that is connecting
;   include = /home/samba/etc/smb.conf.%m

# Some defaults for winbind (make sure you're not using the ranges
# for something else.)
;   idmap uid = 10000-20000
;   idmap gid = 10000-20000
;   template shell = /bin/bash

# Setup usershare options to enable non-root users to share folders
# with the net usershare command.

# Maximum number of usershare. 0 (default) means that usershare is disabled.
;   usershare max shares = 100

# Allow users who've been granted usershare privileges to create
# public shares, not just authenticated ones
#   usershare allow guests = yes
usershare allow guests = no
#======================= Share Definitions =======================
[informatique]
        available = yes
        writeable=yes
        path=/mnt/disk1/informatique
        comment=Dossiers fonctionnels
 write list= @"DREAL-LOR\agents pole informatique", @"DREAL-LOR\Admins du Domaine"

Les droits sur le dossier "informatique" sont ouverts aux personnes de l'informatique à savoir le groupe "agent pole informatique"

root@arkeia-lorr-gp:/mnt/disk1# ls -l
total 24
drwxrwx--- 2 root DREAL-LOR\agents^pole^informatique  4096 janv. 15 16:38 informatique
drwx------ 2 root root                               16384 janv. 13 10:27 lost+found

Depuis un PC sous Windows 7, je vois le partage nommé "informatique" mais une authentification m'est demandé.

Je souhaite utiliser l'authentification Windows pour accéder à ce dossier.
merci pour votre aide

cdlt

eric

Dernière modification par eric-bsm (Le 28/01/2015, à 13:03)


jeune padawane - Ubuntu Server 17.04

Hors ligne

#2 Le 21/01/2015, à 02:18

le cinglé_001

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

Bonjour.

Regarde dans les lignes qui ne sont pas commentées
Un ligne commentées commence par ça #
En gros une ligne commentée veut dire qu'elle n'est pas prise en compte par le système.
Des fois il faut le redémarrer pour que le changement soit pris en compte.


À toi de voir en fonction de ce que tu souhaites.

#3 Le 21/01/2015, à 17:33

eric-bsm

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

bonsoir The-boss,

Je sais bien qu'une ligne en commentaire commence par un #, mais je n'ai pas vu de lignes qui correspondent à ma requête à savoir l'identification automatique sur un serveur Ubuntu en fonction de l'identification windows .

cdlt

eric


jeune padawane - Ubuntu Server 17.04

Hors ligne

#4 Le 22/01/2015, à 04:51

le cinglé_001

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

Bonjour.

Je précise pour les lignes commentées parce que le topic peut être lu par des personnes qui cherchent la solution et qui ne savent pas ce que c'est. wink

#5 Le 22/01/2015, à 09:12

eric-bsm

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

ok, merci The-Boss


jeune padawane - Ubuntu Server 17.04

Hors ligne

#6 Le 22/01/2015, à 10:03

J5012

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

tu as laissé le service samba de ubuntu server en mode standalone, à quoi ca te sert d'avoir suivi le tuto pour l'ajout du serveur ubuntu dans le domaine NT ?

edit : il manque aussi la definition de securite : http://doc.ubuntu-fr.org/samba_smb.conf#security_ads

Dernière modification par J5012 (Le 22/01/2015, à 10:10)

Hors ligne

#7 Le 22/01/2015, à 11:43

eric-bsm

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

le tuto n'est pas adapté à 100 % à la version 14.04, c'est pour cela que j'ai suivi ceci :

http://www.kiloroot.com/add-ubuntu-14-0 … tegration/

J'ai laissé le serveur en "standalone" pour qu'il ne serve qu'à effectuer mes sauvegardes depuis Arkeia et qu'il ne mette pas le bordel dans mon AD.


jeune padawane - Ubuntu Server 17.04

Hors ligne

#8 Le 22/01/2015, à 21:07

J5012

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

si tu laisses le serveur en standalone, passer ce meme serveur dans un domaine NT ne sert à rien ...

Hors ligne

#9 Le 23/01/2015, à 09:21

eric-bsm

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

j'ai modifié le fichier smb.conf comme suit, mais le problème d'authentification subsiste:

[global]

## Browsing/Identification ###

# Change this to the workgroup/NT-domain name your Samba server will part of
#   workgroup = WORKGROUP
 workgroup = dreal-lor
# server string is the equivalent of the NT Description field
#       server string = %h server (Samba, Ubuntu)
        server string = arkeia-lorr-gp
# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
#   wins support = no

# WINS Server - Tells the NMBD components of Samba to be a WINS Client
# Note: Samba can be either a WINS Server, or a WINS Client, but NOT both
   wins server = 10.57.140.24

# This will prevent nmbd to search for NetBIOS names through DNS.
   dns proxy = no
#### Debugging/Accounting ####

# This tells Samba to use a separate log file for each machine
# that connects
   log file = /var/log/samba/log.%m

# Cap the size of the individual log files (in KiB).
   max log size = 1000
   syslog = 0

# Do something sensible when Samba crashes: mail the admin a backtrace
   panic action = /usr/share/samba/panic-action %d
# directory domain controller".
#
# Most people will want "standalone sever" or "member server".
# Running as "active directory domain controller" will require first
# running "samba-tool domain provision" to wipe databases and create a
# new domain.
   #server role = standalone server
        server role = member server
# If you are using encrypted passwords, Samba will need to know what
# password database type you are using.
   passdb backend = tdbsam
#############################
   obey pam restrictions = yes

# This boolean parameter controls whether Samba attempts to sync the Unix
# password with the SMB password when the encrypted SMB password in the
# passdb is changed.
   unix password sync = yes

# For Unix password sync to work on a Debian GNU/Linux system, the following
# parameters must be set (thanks to Ian Kahan <<kahan@informatik.tu-muenchen.de> for
# sending the correct chat script for the passwd program in Debian Sarge).
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .

# This boolean controls whether PAM will be used for password changes
# when requested by an SMB client instead of the program listed in
# 'passwd program'. The default is 'no'.
   pam password change = yes

# This option controls how unsuccessful authentication attempts are mapped
# to anonymous connections
   map to guest = bad user
usershare allow guests = no
include = /etc/samba/smb-local.conf

cdlt
Eric


jeune padawane - Ubuntu Server 17.04

Hors ligne

#10 Le 23/01/2015, à 22:24

J5012

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

1/ un diese devant wins support=no veut dire que c'est le reglage par defaut, donc ton ip pour le serveur wins ne sert a rien
2/ tu dois avoir une section security dans laquelle tu precises qui est le serveur controleur de domaines, qui est le serveur autentifiant les users etc ...

Hors ligne

#11 Le 27/01/2015, à 14:48

eric-bsm

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

bonjour,
Voici un résumé à jour:

J'arrive à me connecter à un dossier Ubuntu depuis mon AD mais en utilisant un compte local.
J'ai encore mes 2 lignes d'erreur au démarrage:

root@arkeia-lorr-gp:/mnt/disk1# grep fail /var/log/boot.log
 * Starting load fallback graphics devices                                                                               [fail]
 * Starting SMB/CIFS File and Active Directory Server                                                                    [fail]

La version de samba est : Version 4.1.6-Ubuntu

Je liste bien tous les groupes et utilisateurs de mon AD

Le dossier "informatique" est bien partagé aux administrateurs du domaine

root@arkeia-lorr-gp:/mnt/disk1# ls -l
total 20
drwxrwxrwx 2 root DREAL-LOR\admins^du^domaine  4096 Jan 27 11:16 informatique
drwx------ 2 root root                        16384 Jan 13 10:27 lost+found

Le fichier smb.conf :

[global]
workgroup = dreal-lor
server string = %h server (Samba, Ubuntu)
wins server = adresse Ip de mon serveur wins
dns proxy = no
server role = member server
passdb backend = tdbsam
obey pam restrictions = yes
unix password sync = yes
passwd program = /usr/bin/passwd %u
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
pam password change = no
usershare allow guests = yes
include = /etc/samba/smb-local.conf

[printers]
   comment = All Printers
   browseable = no
   path = /var/spool/samba
   printable = yes
   guest ok = no
   read only = yes
   create mask = 0700

# Windows clients look for this share name as a source of downloadable
# printer drivers
[print$]
   comment = Printer Drivers
   path = /var/lib/samba/printers
   browseable = yes
   read only = yes
   guest ok = no

et le contenu de mon fichier smb-local.conf:

[informatique]
        available = yes
        writeable=yes
        path=/mnt/disk1/informatique
        comment=Dossiers fonctionnels
        directory mask = 770
        create mask = 770
        admin users = @"DREAL-LOR\agents pole informatique", @"DREAL-LOR\Admins du Domaine"
        write list= @"DREAL-LOR\agents pole informatique", @"DREAL-LOR\Admins du Domaine"

je vous remercie pour votre aide
Eric-bsm


jeune padawane - Ubuntu Server 17.04

Hors ligne

#12 Le 27/01/2015, à 20:31

J5012

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

tu es donc sourd ?
j'ai dit ci-dessus, qu'ignorer l'option wins support equivaut au reglage par defaut → pas de wins
mettre une ip sur wins ne suffit pas à activer wins

# Windows Internet Name Serving Support Section:
# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
#   wins support = no

et il te manque toujours la section security où tu dois definir le serveur ADS comme ctrleur de domaines ...

Hors ligne

#13 Le 28/01/2015, à 13:03

eric-bsm

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

Bonjour J5212,

Je ne suis pas sourd comme tu l'entend mais simplement débutant (comme tu l'as été je pense).
J'ai fais toutes les corrections que tu m'as proposés sans résultat.
Le serveur sur lequel je travaille étant opérationnel, je n'ose pas trop m'aventurer.

Je vais me faire un serveur de test et recommencer mes essais.

merci

eric-bsm


jeune padawane - Ubuntu Server 17.04

Hors ligne

#14 Le 28/01/2015, à 19:05

J5012

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

j'ai ete debutant en effet, mais je ne me suis jamais jete dans une config tres compliquee sans en comprendre le moindre mot , or smb.conf est abondamment documentée ... tu sembles passer bcp de temps sur la config des partages, or cette section de la config est bien secondaire ... la principale est que le service samba soit effectivement reconnu comme membre du domaine et puisse/sache consulter ton serveur ctleur de domaines pour savoir quels utilisateurs ont quels droits d'acces ... or ces details precis de config ne peuvent etre effectues sans tenir compte de la section security, ce dont je te parle depuis plusieurs reponses deja ...

Hors ligne

#15 Le 28/01/2015, à 19:21

eric-bsm

Re : [RESOLU] accès à un dossier en utilisant l'authentification Windows

bonsoir J5012,
Je vais installer Ubuntu 14.04.01 LTS sur une machine virtuelle afin de faire mes essais sans endommager mon serveur de sauvegarde.
J'ai bien pris note de tes conseils et je reviendrais, d'ici peu je l'espère, te donner de bonnes nouvelles.

cdlt

Eric-bsm
(et encore merci)


jeune padawane - Ubuntu Server 17.04

Hors ligne