serveur Samba

Installation, configuration et utilisation des logiciels que vous souhaitez installer.
Répondre
mpedro
Messages : 1517
Enregistré le : dim. 8 nov. 2015 22:13
Contact :

serveur Samba

Message par mpedro »

J'ai jamais aimé Samba et essaie de mettre en place le transfert wifi automatique des photos d'un tél Androïd sur un répertoire partagé en Lan.

Code : Tout sélectionner

sudo service samba status
● samba.service
   Loaded: masked (/dev/null; bad)
   Active: inactive (dead)
mayataya maya # sudo service smbd start
mayataya maya # sudo service nmbd start
mayataya maya # sudo service samba start
Failed to start samba.service: Unit samba.service is masked.
mayataya maya # sudo /etc/init.d/smbd start
[ ok ] Starting smbd (via systemctl): smbd.service.
mayataya maya # sudo /etc/init.d/nmbd start
[ ok ] Starting nmbd (via systemctl): nmbd.service.
mayataya maya # sudo systemctl enable smbd.service
smbd.service is not a native service, redirecting to systemd-sysv-install
Executing /lib/systemd/systemd-sysv-install enable smbd
mayataya maya # sudo service samba start
Failed to start samba.service: Unit samba.service is masked.

Code : Tout sélectionner

testparm -s
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
WARNING: The "syslog" option is deprecated
Processing section "[printers]"
Processing section "[print$]"
Processing section "[synchro]"
Processing section "[sauvegarde]"
Processing section "[Bureau]"
Loaded services file OK.
Server role: ROLE_STANDALONE

# Global parameters
[global]
	server string = %h server (Samba, Ubuntu)
	server role = standalone server
	security = USER
	encrypt passwords = No
	map to guest = Bad User
	obey pam restrictions = Yes
	guest account = maya
	pam password change = Yes
	passwd program = /usr/bin/passwd %u
	passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
	username map = /etc/samba/smbusers
	unix password sync = Yes
	syslog = 0
	log file = /var/log/samba/log.%m
	max log size = 1000
	dns proxy = No
	usershare allow guests = Yes
	panic action = /usr/share/samba/panic-action %d
	idmap config * : backend = tdb
	guest ok = Yes


[printers]
	comment = All Printers
	path = /var/spool/samba
	create mask = 0700
	printable = Yes
	browseable = No


[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers
	valid users = _apt maya
	read only = No


[synchro]
	path = /home/maya/Bureau/synchro
	valid users = _apt
	read only = No


[sauvegarde]
	path = /home/maya/Bureau/sauvegarde
	read only = No


[Bureau]
	path = /home/maya/Bureau
	valid users = maya
	read only = No
Le fichier conf

Code : Tout sélectionner

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

[global]

## Browsing/Identification ###

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

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


# WINS Support - Tells the NMBD component of Samba to enable its WINS Server
#   wins support = yes

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

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

#### Networking ####

# The specific set of interfaces / networks to bind to
# This can be either the interface name or an IP address/netmask;
# interface names are normally preferred
;   interfaces = 127.0.0.0/8 eth0

# Only bind to the named interfaces and/or networks; you must use the
# 'interfaces' option above to use this.
# It is recommended that you enable this feature if your Samba machine is
# not protected by a firewall or is a firewall itself.  However, this
# option cannot handle dynamic or non-broadcast interfaces correctly.
;   bind interfaces only = yes



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

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


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

# public shares, not just authenticated ones
	usershare allow guests = yes
	security = user
	encrypt passwords = no
	guest ok = yes
	guest account = maya
	username map = /etc/samba/smbusers

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

# Un-comment the following (and tweak the other settings below to suit)
# to enable the default home directory shares. This will share each
# user's home directory as \\server\username
;[homes]
;   comment = Home Directories
;   browseable = 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.
;   read only = yes

# File creation mask is set to 0700 for security reasons. If you want to
# create files with group=rw permissions, set next parameter to 0775.
;   create mask = 0700

# Directory creation mask is set to 0700 for security reasons. If you want to
# create dirs. with group=rw permissions, set next parameter to 0775.
;   directory mask = 0700


;   valid users = %S


;[netlogon]
;   comment = Network Logon Service
;   path = /home/samba/netlogon
;   guest ok = yes
;   read only = yes


;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = no
;   browseable = no
;   create mask = 0600
;   directory mask = 0700

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

# printer drivers
[print$]
	comment = Printer Drivers
	path = /var/lib/samba/printers
;	browseable = yes
	writeable = yes
	valid users = _apt, maya

;   write list = root, @lpadmin

[synchro]
	path = /home/maya/Bureau/synchro
	writeable = yes
;	browseable = yes
	valid users = _apt

[sauvegarde]
	path = /home/maya/Bureau/sauvegarde
	writeable = yes
;	browseable = yes
	guest ok = yes

[Bureau]
	path = /home/maya/Bureau
	writeable = yes
;	browseable = yes
	valid users = maya
smbd et nmbd sont bien actifs
Stretch 32bits cinnamon/Fedora25/Sarah
Compaq 8510p/MSI GE70/Raspberry Pi2

zeb
Messages : 16473
Enregistré le : ven. 19 juin 2015 22:13
Localisation : plus ici

Re: serveur Samba

Message par zeb »

Salut mpedro ;)
J'ai modifié les balises "quote" par des "code" ;)
la molette de ma souris m'a supplier de le faire :P

mpedro
Messages : 1517
Enregistré le : dim. 8 nov. 2015 22:13
Contact :

Re: serveur Samba

Message par mpedro »

Merci Zébulon.

J'ai tout désinstallé puis réinstallé le paquet samba et l'interface graphique system-config-samba

Le service nmbd sert à l'envoi et la découverte des noms NetBIOS (nom des machines) dans le réseau local

Code : Tout sélectionner

sudo systemctl enable nmbd

Code : Tout sélectionner

sudo service nmbd status
● nmbd.service - LSB: start Samba NetBIOS nameserver (nmbd)
   Loaded: loaded (/etc/init.d/nmbd; bad; vendor preset: enabled)
   Active: active (running) since ven. 2017-07-21 04:26:40 EST; 6min ago
     Docs: man:systemd-sysv-generator(8)
   CGroup: /system.slice/nmbd.service
           └─27224 /usr/sbin/nmbd -D[/quote]

[code]sudo service samba restart
[sudo] Mot de passe de maya : 
Failed to restart samba.service: Unit samba.service is masked.
Toujours ce foutu Unit samba.service is masked (peut importe l'origine des paquets).

Avec system-config-samba il n'est pas possible de créer un dossier c'est étonnant
Modifié en dernier par débitant le ven. 21 juil. 2017 11:42, modifié 1 fois.
Stretch 32bits cinnamon/Fedora25/Sarah
Compaq 8510p/MSI GE70/Raspberry Pi2

mpedro
Messages : 1517
Enregistré le : dim. 8 nov. 2015 22:13
Contact :

Re: serveur Samba

Message par mpedro »

Le fichier de log smbd pour Windows

Code : Tout sélectionner

[2017/07/21 04:09:32.489784,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2017/07/21 04:11:32.708302,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2017/07/21 04:17:42.587400,  0] ../source3/lib/interface.c:543(load_interfaces)
  WARNING: no network interfaces found
[2017/07/21 04:17:42.607074,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2017/07/21 04:17:42.608118,  0] ../source3/smbd/server.c:877(open_sockets_smbd)
  open_sockets_smbd: No sockets available to bind to.
[2017/07/21 04:17:42.608321,  0] ../source3/lib/util.c:789(smb_panic_s3)
  PANIC (pid 26599): open_sockets_smbd() failed
[2017/07/21 04:17:42.686673,  0] ../source3/lib/util.c:900(log_stack_trace)
  BACKTRACE: 9 stack frames:
   #0 /usr/lib/i386-linux-gnu/samba/libsmbregistry.so.0(log_stack_trace+0x21) [0xb7269a01]
   #1 /usr/lib/i386-linux-gnu/samba/libsmbregistry.so.0(smb_panic_s3+0x25) [0xb7269ae5]
   #2 /usr/lib/i386-linux-gnu/libsamba-util.so.0(smb_panic+0x3b) [0xb765d35b]
   #3 /usr/lib/i386-linux-gnu/samba/libsmbd-base.so.0(+0x139878) [0xb73db878]
   #4 /usr/lib/i386-linux-gnu/samba/libsmbd-base.so.0(+0x139c31) [0xb73dbc31]
   #5 /usr/lib/i386-linux-gnu/samba/libsmbd-shim.so.0(exit_server+0x22) [0xb6ea4ac2]
   #6 /usr/sbin/smbd(main+0x1500) [0x8000e360]
   #7 /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf7) [0xb68f1637]
   #8 /usr/sbin/smbd(+0x5b48) [0x8000eb48]
[2017/07/21 04:17:42.686784,  0] ../source3/lib/util.c:801(smb_panic_s3)
  smb_panic(): calling panic action [/usr/share/samba/panic-action 26599]
[2017/07/21 04:17:42.690631,  0] ../source3/lib/util.c:809(smb_panic_s3)
  smb_panic(): action returned status 0
[2017/07/21 04:17:42.690691,  0] ../source3/lib/dumpcore.c:303(dump_core)
  dumping core in /var/log/samba/cores/smbd
[2017/07/21 04:26:39.988988,  0] ../source3/lib/interface.c:543(load_interfaces)
  WARNING: no network interfaces found
[2017/07/21 04:26:40.010175,  0] ../lib/util/become_daemon.c:124(daemon_ready)
  STATUS=daemon 'smbd' finished starting up and ready to serve connections
[2017/07/21 04:26:40.011296,  0] ../source3/smbd/server.c:877(open_sockets_smbd)
  open_sockets_smbd: No sockets available to bind to.
[2017/07/21 04:26:40.011520,  0] ../source3/lib/util.c:789(smb_panic_s3)
  PANIC (pid 27136): open_sockets_smbd() failed
[2017/07/21 04:26:40.011867,  0] ../source3/lib/util.c:900(log_stack_trace)
  BACKTRACE: 9 stack frames:
   #0 /usr/lib/i386-linux-gnu/samba/libsmbregistry.so.0(log_stack_trace+0x21) [0xb72d9a01]
   #1 /usr/lib/i386-linux-gnu/samba/libsmbregistry.so.0(smb_panic_s3+0x25) [0xb72d9ae5]
   #2 /usr/lib/i386-linux-gnu/libsamba-util.so.0(smb_panic+0x3b) [0xb76cd35b]
   #3 /usr/lib/i386-linux-gnu/samba/libsmbd-base.so.0(+0x139878) [0xb744b878]
   #4 /usr/lib/i386-linux-gnu/samba/libsmbd-base.so.0(+0x139c31) [0xb744bc31]
   #5 /usr/lib/i386-linux-gnu/samba/libsmbd-shim.so.0(exit_server+0x22) [0xb6f14ac2]
   #6 /usr/sbin/smbd(main+0x1500) [0x80067360]
   #7 /lib/i386-linux-gnu/libc.so.6(__libc_start_main+0xf7) [0xb6961637]
   #8 /usr/sbin/smbd(+0x5b48) [0x80067b48]
[2017/07/21 04:26:40.011942,  0] ../source3/lib/util.c:801(smb_panic_s3)
  smb_panic(): calling panic action [/usr/share/samba/panic-action 27136]
[2017/07/21 04:26:40.015256,  0] ../source3/lib/util.c:809(smb_panic_s3)
  smb_panic(): action returned status 0
[2017/07/21 04:26:40.015313,  0] ../source3/lib/dumpcore.c:303(dump_core)
  dumping core in /var/log/samba/cores/smbd
Pour samba4 mais le paquet d'installation était déjà en version 4

Code : Tout sélectionner

sudo apt-get install libsmbclient libwbclient0 python-dnspython python-samba python3-smbc samba samba-common samba-common-bin samba-dsdb-modules samba-libs samba-vfs-modules smbclient
Ce fil https://forums.linuxmint.com/viewtopic.php?t=225171" onclick="window.open(this.href);return false; n'apporte rien.
Stretch 32bits cinnamon/Fedora25/Sarah
Compaq 8510p/MSI GE70/Raspberry Pi2

mpedro
Messages : 1517
Enregistré le : dim. 8 nov. 2015 22:13
Contact :

Re: serveur Samba

Message par mpedro »

Code : Tout sélectionner

sudo /etc/init.d/smbd start
[ ok ] Starting smbd (via systemctl): smbd.service.
maya@mayataya ~ $ sudo /etc/init.d/nmbd start
[ ok ] Starting nmbd (via systemctl): nmbd.service.
maya@mayataya ~ $ sudo service samba start
Failed to start samba.service: Unit samba.service is masked.
maya@mayataya ~ $ 
la commande échoue
Modifié en dernier par zeb le ven. 21 juil. 2017 22:11, modifié 1 fois.
Raison : modification des balises
Stretch 32bits cinnamon/Fedora25/Sarah
Compaq 8510p/MSI GE70/Raspberry Pi2

mpedro
Messages : 1517
Enregistré le : dim. 8 nov. 2015 22:13
Contact :

réinstaller Samba

Message par mpedro »

Le paquet samba n'a pas pu être installé par le gestionnaire de logiciel :
Traceback (most recent call last):
File "/usr/lib/linuxmint/mintinstall/AptClient/AptClient.py", line 74, in _run
cache.commit(acquire_progress_monitor, install_progress_monitor)
File "/usr/lib/python2.7/dist-packages/apt/cache.py", line 519, in commit
raise SystemError("installArchives() failed")
SystemError: installArchives() failed

Mais il apparaît quand-même installé au niveau du gestionnaire de logiciel

Si j'installe samba via le terminal :

Code : Tout sélectionner

● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
   Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
   Active: failed (Result: exit-code) since sam. 2017-07-22 00:01:14 EST; 9ms ago
     Docs: man:systemd-sysv-generator(8)
  Process: 3596 ExecStart=/etc/init.d/smbd start (code=exited, status=1/FAILURE)

juil. 22 00:01:14 mayataya systemd[1]: Starting LSB: start Samba SMB/CIFS d.....
juil. 22 00:01:14 mayataya smbd[3596]:  * Starting SMB/CIFS daemon smbd
juil. 22 00:01:14 mayataya smbd[3596]:    ...fail!
juil. 22 00:01:14 mayataya systemd[1]: smbd.service: Control process exited...=1
juil. 22 00:01:14 mayataya systemd[1]: Failed to start LSB: start Samba SMB...).
Hint: Some lines were ellipsized, use -l to show in full.
dpkg: erreur de traitement du paquet samba (--configure) :
 le sous-processus script post-installation installé a retourné une erreur de sortie d'état 1
Traitement des actions différées (« triggers ») pour libc-bin (2.23-0ubuntu9) ...
Des erreurs ont été rencontrées pendant l'exécution :
 samba
E: Sub-process /usr/bin/dpkg returned an error code (1)
Pour autant smbd est ok

Code : Tout sélectionner

sudo service smbd start

Code : Tout sélectionner

$ sudo service smbd status
● smbd.service - LSB: start Samba SMB/CIFS daemon (smbd)
   Loaded: loaded (/etc/init.d/smbd; bad; vendor preset: enabled)
   Active: active (exited) since sam. 2017-07-22 00:10:05 EST; 2s ago
     Docs: man:systemd-sysv-generator(8)
  Process: 6959 ExecStart=/etc/init.d/smbd start (code=exited, status=0/SUCCESS)

juil. 22 00:10:05 mayataya systemd[1]: Starting LSB: start Samba SMB/CIFS daemon (smbd)...
juil. 22 00:10:05 mayataya systemd[1]: Started LSB: start Samba SMB/CIFS daemon (smbd).
Samba est HS

Code : Tout sélectionner

sudo dpkg-reconfigure samba
/usr/sbin/dpkg-reconfigure: samba est cassé ou partiellement installé
Le PC est à jour. Comment réinstaller ce serveur ? à priori python est à jour
Stretch 32bits cinnamon/Fedora25/Sarah
Compaq 8510p/MSI GE70/Raspberry Pi2

Répondre