Samba et les acces via Windaube

Bonjour a tous,

VOila jái un serveur qui appartient a ma societe et je dois le gerer pendant 3 mois sans toucher a grand chose comme m’a dit l’administrateur qui est parti en vacance. (Pas possible de le contacter). Je me debrouille pas trop mal sous Debian mais il y a des points qui me pose des fois probleme. Voila mon patron m’a demande de mettre un mot de passe sur le partage “Mickey Staff”. Les ordinateurs windows sont en Workgroup et donc ils ne sont pas sur un domaine. J’ai acces au partage sur le reseau et je vois tous les dossiers samba mais celui que je configure avec un mot de passe ne fonctionne pas (Acces impossible).

J’ai etudie les docs sur Internet et je suis arrivee a creer mon compte “mickey” avec password : smbpasswd et aussi cree adduser “mickey” et groupuser “mickey”. J’ai rajoute dans le smb.conf la ligne pour “Mickey Staff” :
valid users = mickey

j’ai aussi avec cree des sous dossiers dans /var
/var/samba/profiles
/var/samba/netlogon

Quand je retire la ligne j’accede au dossier bien entendu

A l’heure actuel il n’accede pas au dossier et donc il ne me demande pas de mot de passe … :angry:

VOICI UNE COPIE DE MON FICHIER SAMBA


NOTE: Whenever you modify this file you should run the command

“testparm” to check that you have not made any basic syntactic errors.

#======================= Global Settings =======================

[global]
workgroup = Workgroup
netbios name = Mickey_Server
server string = Mickey_Server
wins support = yes
dns proxy = no
name resolve order = wins host lmhosts wins bcast
interfaces = lo eth1 eth2 eth0

Debugging/Accounting

This tells Samba to use a separate log file for each machine that connects

log file = /var/log/samba/log.%m
max log size = 1000

We want Samba to log a minimum amount of information to syslog. Everything

should go to /var/log/samba/log.{smbd,nmbd} instead. If you want to log

through syslog you should set the following parameter to something higher.

syslog = 0

Do something sensible when Samba crashes: mail the admin a backtrace

panic action = /usr/share/samba/panic-action %d

####### Authentication #######

“security = user” is always a good idea. This will require a Unix account

in this server for every user accessing the server.

security = user

You may wish to use password encryption.

encrypt passwords = true

If you are using encrypted passwords, Samba will need to know what

password database type you are using.

passdb backend = tdbsam
null passwords = true
obey pam restrictions = yes
map to guest = bad user

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
username map = /etc/samba/user.map

pour faire fonctionner les liens symboliques

unix extensions = no
follow symlinks = yes

For Unix password sync to work on a Debian GNU/Linux system, the following

parameters must be set

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 = no

########## Domains ###########

Is this machine able to authenticate users. Both PDC and BDC

must have this setting enabled. If you are the BDC you must

change the ‘domain master’ setting to no

domain logons = yes

The following setting only takes effect if ‘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 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

########## Printing ##########

If you want to automatically load your printer list rather

than setting them up individually then you’ll need this

load printers = yes

lpr(ng) printing. You may wish to override the location of the

printcap file

; printing = bsd
; printcap name = /etc/printcap

CUPS printing. See also the cupsaddsmb(8) manpage in the

cupsys-client package.

printing = cups
printcap name = cups

############ 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

The following was the default behaviour in sarge,

but samba upstream reverted the default because it might induce

performance issues in large organizations.

winbind enum groups = yes
winbind enum users = yes
winbind use default domain = yes

Maximum number of usershare. 0 (default) means that usershare is disabled.

; usershare max shares = 100

#======================= Share Definitions =======================

[homes]
comment = Home Directories
path = /home/%U
browseable = No
read only = No

By default, the home directories are exported read-only. Change the

next parameter to ‘no’ if you want to be able to write to them.

writeable = yes

File and directory creation mask is set to 0700 for security reasons. If

you want to create files with group=rw permissions, set

next parameter to 0775 / 0755

create mask = 0777
directory mask = 0777

By default, \server\username shares can be connected to by anyone

with access to the samba server.

The following parameter makes sure that only “username” can connect

to \server\username

This might need tweaking when using external authentication schemes

valid users = %S

Un-comment the following and create the netlogon directory for Domain Logons

(you need to configure Samba to act as a domain controller too.)

[netlogon]
comment = Network Logon Service
path = /var/samba/netlogon
browseable = no

Un-comment the following and create the profiles directory to store

users profiles (see the “logon path” option above)

(you need to configure Samba to act as a domain controller too.)

The path below should be writable by all users

[profiles]
comment = Users profiles
path = /var/samba/profiles
browseable = no

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

Windows clients look for this share name as a source of downloadable

printer drivers

[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
browseable = no
read only = yes
force user = root
write list = root
guest ok = yes
create mask = 0777
directory mask = 0777

[Public]
comment = Public
read only = no
write list = root
force user = root
locking = no
path = /home/admin1/public
browseable = yes
guest ok = yes
create mask = 0777
directory mask = 0777

[Netlogon]
comment = Netlogon service
read only = no
write list = root
force user = root
locking = no
path= /home/admin1/netlogon
create mask = 0777
directory mask = 0777
browseable = no

[ris]
path = /home/admin1/ris
browsable = no
read only = no
force user = root
write list = root
guest ok = Yes
create mask = 0755
directory mask = 0755

[Mickey Staff (Read and write)]
comment = Mickey Staff (Read and Write)
read only = no
write list = root
force user = root
writeable = yes
path = /home/admin1/Staff
valid users = mickey
browseable = yes
locking = no
create mask = 0777
directory mask = 0777

The next two parameters show how to auto-mount a CD-ROM when the

The next two parameters show how to auto-mount a CD-ROM when the

cdrom share is accesed. For this to work /etc/fstab must contain

an entry like this:

/dev/scd0 /cdrom iso9660 defaults,noauto,ro,user 0 0

The CD-ROM gets unmounted automatically after the connection to the

If you don’t want to use auto-mounting/unmounting make sure the CD

is mounted on /cdrom

; preexec = /bin/mount /cdrom
; postexec = /bin/umount /cdrom

[CD-ROM (Read only)]

commentaire visible depuis le voisinage reseau

comment = CD-ROM (Read only)

chemin d’acces au lecteur

path = /cdrom

accessible tous

public = yes

impossibilite d’ecrire sur la ressource

writable = no

create mask = 0750


Si quelqu’un a une idee :smiley:

En vous remerciant,

Mickey Mouse

J’ai entre temps aussi modifie la ligne /home/admin1/netlogon qui n’etait pas bon en /var/samba/netlogon

mais rien de +

En même temps, si t’es pas sur un domaine, ils servent à quoi [profiles] et [netlogon] ?

Plutôt que de poster le (long) smb.conf, utilises la commande :

Ça te sort la conf de samba dans un format plus lisible (sans toutes les lignes de commentaires). En prime, ça t’indique s’il y a une erreur de syntaxe…

[Mickey Staff (Read and write)]
comment = Repertoire privé du serveur
path = /home/admin1/Staff
valid users = @mickey
writable = yes
browseable = yes
guest ok = no

La commande testparm te renvoie des erreurs de syntaxe concernant ton fichier de conf.
Enfin oubli pas de redémarré le service pour appliquer les modifications.