logo Debian Debian Debian-France Debian-Facile Debian-fr.org Forum-Debian.fr Debian ? Communautés logo inclusivité

Debian-facile

Bienvenue sur Debian-Facile, site d'aide pour les nouveaux utilisateurs de Debian.

Vous n'êtes pas identifié(e).

#1 19-06-2017 12:09:11

Belfaigore
Membre
Inscription : 12-06-2017

Partage de fichier Samba 4 <-> Windows 10

Bonjour chacun,

Je partage avec vous ce point, car j'ai eu des difficultés à mettre en place un partage de fichier entre Samba (4.5.8) et Windows 10 ; je vous post donc MA résolution du problème (s'il y a plus simple ou mieux, n’hésitez pas à compléter ce sujet).

Le problème étant (de se que j'en comprend) que Windows 10 ne prend pas en charge le protocol de Samba 4 ; donc il faut ajouter dans la configuration samba (/etc/samba/smb.conf), dans la section [global] les paramètres suivants :

min protocol = LANMAN2
max protocol = NT1


ceci me permet de me connecter via smbclient (sous linux) et Windows 10 dans un explorateur windows

De plus, faite attention aux firewall, sur le serveur samba, j'ai 'gufw'

ufw allow 139/tcp

, coté windows, bien vérifier que le partage de fichier et la découverte du réseau sont activés

J'ai pas pu vérifier s'il y avait un vrai intérêt mais j'ai également mis en place la DWORD suivante dans Windows 10 (autoriser les connections non securisées)

Mettre la DWORD à 1 : HKLM\SYSTEM\CurrentControlSet\Services\LanmanWorkstation\Parameters\AllowInsecureGuestAuth



Pour un partage non-sécurisé (mode invité, sans mot de passe) dans /srv/samba/public, je vous partage mon fichier de config

#
# Sample configuration file for the Samba suite for Debian GNU/Linux.
#
#
# This is the main Samba configuration file. You should read the
# smb.conf(5) manual page in order to understand the options listed
# here. Samba has a huge number of configurable options most of which
# are not shown in this example
#
# Some options that are often worth tuning have been included as
# commented-out examples in this file.
#  - When such options are commented with ";", the proposed setting
#    differs from the default Samba behaviour
#  - When commented with "#", the proposed setting is the default
#    behaviour of Samba but the option is considered important
#    enough to be mentioned here
#
# 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]
############ Browsing/Identification ############

# Change this to the workgroup/NT-domain name your Samba server will part of
   workgroup                 = WORKGROUP
   server string             = %h server
   netbios name              = samba-srv

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

# 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

# If you want Samba to only log through syslog then set the following
# parameter to 'yes'.
;   syslog only               = no

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

# 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.  
   encrypt passwords         = true
   passdb backend            = smbpasswd
   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
   
# This parameter determines whether or not smbd(8) will attempt to authenticate users or permit password changes using the LANMAN password hash. If disabled, only clients which support NT password hashes (e.g. Windows NT/2000 clients, smbclient, but not Windows 95/98 or the MS DOS network client) will be able to connect to the Samba host.
   lanman auth               = no
 
# The value of the parameter (a string) is the protocol that will be supported by the server.
# Use max NT1 with Windows 10
   min protocol              = LANMAN2
   max protocol              = NT1
;   main protocol             = NT1

# Set guest login  
;   guest ok                  = no
;   guest account             = nobody
   
############ Tuning option ############

# This option allows you to set socket options to be used when talking with the client.
# Socket options are controls on the networking layer of the operating systems which allow the connection to be tuned.
# This option will typically be used to tune your Samba server for optimal performance for your local network. There is no way that Samba can know what the optimal parameters are for your net, so you must experiment and choose them yourself. We strongly suggest you read the appropriate documentation for your operating system first (perhaps man setsockopt will help).
   socket options            = TCP_NODELAY SO_KEEPALIVE IPTOS_LOWDELAY SO_RCVBUF=65536 SO_SNDBUF=65536

# 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
   security                  = user
;   username map              = /etc/samba/smbusers

# This cache allows Samba to batch client writes into a more efficient write size for RAID disks (i.e. writes may be tuned to be the RAID stripe size) and can improve performance on systems where the disk subsystem is a bottleneck but there is free memory for userspace programs.
   write cache size          = 2097152

# If this parameter is yes, and the sendfile() system call is supported by the underlying operating system, then some SMB read calls (mainly ReadAndX and ReadRaw) will use the more efficient sendfile system call for files that are exclusively oplocked. This may make more efficient use of the system CPU's and cause Samba to be faster. Samba automatically turns this off for clients that use protocol levels lower than NT LM 0.12 and when it detects a client is Windows 9x (using sendfile from Linux will cause these clients to fail).
   use sendfile              = yes

# This is a tuning option. When this is enabled a caching algorithm will be used to reduce the time taken for getwd() calls. This can have a significant impact on performance, especially when the wide smbconfoptions parameter is set to no.
   getwd cache               = yes

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

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

[homes]
   comment = Home Directories
   browseable = no
   read only = no
   create mask = 0700
   directory mask = 0700
   valid users = %S

[Public]
   comment                   = Dossier partagé sur le serveur Samba
   path                      = /srv/samba/public
   browsable                 = yes
   writeable                 = yes
   guest ok                  = yes
   read only                 = no
   create mask               = 0755

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

;[print$]
;   comment = Printer Drivers
;   path = /var/lib/samba/printers
;   browseable = yes
;   read only = yes
;   guest ok = no
;   write list = root, @lpadmin
 

Dernière modification par Belfaigore (19-06-2017 12:12:59)

Hors ligne

#2 23-06-2017 17:48:27

lagrenouille
CA Debian-Facile
Lieu : Toulouse
Distrib. : bookworm
Noyau : d'olive
(G)UI : xfce4 et awesome
Inscription : 28-03-2012
Site Web

Re : Partage de fichier Samba 4 <-> Windows 10

ça devrait pas poser problème si tu as installé smb et cifs-utils

mais plus simple

installe toi  winscp sous windows
c'est gratos

Dernière modification par lagrenouille (23-06-2017 17:50:42)


Ce à quoi l'on a pas accès par l'expérience vécue, on a pas d'oreilles pour l'entendre ..Nietzsche
Cela dit, bien que toute notre connaissance s’amorce avec l’expérience, il n’en résulte pas pour autant qu’elle découle dans sa totalité de l’expérience.  E.Kant
une compréhension insane est elle forcément irrationnel ? ..lagrenouille

Hors ligne

Pied de page des forums