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 01/05/2026, à 15:20

dringdring

[à jamais irrésolu] samba partage simple? sous ubuntu 24.04

Bonjour à tous,
voici le problème :
je suis passé définitivement sur ubuntu 24.04 pour mon ordi principal
et j'ai un disque dur connecté en usb dessus qui me sers de bibliothèque pour un peut tout.(format ntfs)(il se monte au démarrage apparemment)
j'ai un autre ordi sous win 11 et je veux partager tout le disque usb (ou un de ses répertoires  au moins) comme c'était sous win
j'ai donc suivi de multiples tutos installé samba, nautilus share, essayé de comprendre smb.conf mais rien n'y fait.
win 11 arrive à pinguer sur l'ordi ubuntu , mais son réseau ne le voit pas.
j'aimerais pouvoir atteindre ce disque moyennant mon profil user (ou un créé pour l'occasion)   et mon mot de passe de session( ou un dédié au partage)

y a t-il un tuto simple pour faire cela ?perso je n'ai pas trouvé.

j'ai tenté un fichier "partage" avec dedans un lien vers mon disque dans mon home, mais ..rien!  de plus le disque monté est dans /media/utilisateur/nom_du_disque qui est hors home.
faut-il créer un utilisateur ? mais je ne vois pas pourquoi ni où?
j'avoue ne plus rien comprendre

par pitié, évitez les renvois sur des tutos soi-disant parfaits qui ne répondent que partiellement au problème...
un pas à pas serait sympathique. (avec toutes le étapes création de compte par exemple et seulement après dans samba conf)
(dans le wiki documentation j'ai suivi ce que j'ai pu mais échec sur toute la ligne.)
Cordialement
dringdring

Dernière modification par dringdring (Le 04/05/2026, à 09:39)

Hors ligne

#2 Le 04/05/2026, à 09:38

dringdring

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

Bonjour, à tous
apparemment un partage sur ubuntu d'un disque usb en ntfs
ne se fait pas de façon simple donc je vais renoncer
4 jours de galères dessus sans resultat!
Cordialement
drindring

Hors ligne

#3 Le 04/05/2026, à 12:56

bonuscad

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

Bonjour,
Depuis la version Héron (ça remonte pas mal en arrière), je n'ai plus réussi à faire un partage efficient avec samba, c'était toujours bancal..., surtout avec un NAS ancien qui ne peut pas être mis à jour (fonctionne avec smb1)
Depuis j'ai adopté WINSCP pour windows et REMMINA pour linux, parfaitement compatible entre eux et simple à mettre en place sur les 2 OS. Par contre sert essentiellement à du transfert de fichiers entre les systèmes.

Hors ligne

#4 Le 04/05/2026, à 14:04

dringdring

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

Bonjour bonuscad
Merci de m'apporter quelques commentaires,

pour moi Remmina est une prise en main à distance donc pas utile dans mon cas
j'ai tendance à utiliser rustdesk quoiqu'avec des problèmes en auto hébergement)

quant au win je ne le lance que de temps à autre quand j'ai besoin d'une mise à jour GPS
garmin ne faisant rien sur linux, (en tous cas pas avec mon GPS)

mon disque dur étant comme une bibliothèque je voulais sans le débrancher rebrancher l'atteindre
depuis windows (c'est la raison pour laquelle je n'ai pas formaté en ext4 ,win ne le lisant pas)...

en lisant différents wiki il s'avère que c'est samba qu'il faut utiliser...

j'avoue que même les ordres donnés sur ubuntu.org sont sujets à caution,
la commande me renvoyant commande [options etc etc]

cordialement
Dingdring

Hors ligne

#5 Le 04/05/2026, à 14:20

iznobe

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

Bonjour , j ' ai toujours des partages samba en place sur ma machine ( que ce soit en 20.04 , en 22.04 , en 24.04 ou en 26.04) , qui me servent presque jamais , c ' est pour l ' ordi de ma femme , dans le cas où on a besoin d ' échanger des fichiers , ce qui arrive occasionnellement , essentiellement pour des photos .

iznobe@iznobe-PC-U26:~$ smbclient -L 127.0.0.1
Password for [WORKGROUP\iznobe]:

	Sharename       Type      Comment
	---------       ----      -------
	print$          Disk      Printer Drivers
	Vidéos         Disk      
	Photos          Disk      
	Musique         Disk      
	Public          Disk      
	IPC$            IPC       IPC Service (iznobe-PC-U26 server (Samba, Ubuntu))
SMB1 disabled -- no workgroup available
iznobe@iznobe-PC-U26:~$ 

il est vrai que je n ' ai aucune machine en SMBV1 cela dit .

Hors ligne

#6 Le 04/05/2026, à 14:34

dringdring

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

Bonjour iznobe
en utilisant ta commande

smbclient -L 127.0.0.1

je me suis rendu compte que je n'avais pas le client samba...
peut-être le serveur
elle renvoie ceci après installation :

premier@ci7-230:~$ smbclient -L 127.0.0.1
Password for [WORKGROUP\premier]:

	Sharename       Type      Comment
	---------       ----      -------
	print$          Disk      Printer Drivers
	DATA4To         Disk      
	IPC$            IPC       IPC Service (ci7-230 server (Samba, Ubuntu))
	Serveur         Disk      
Reconnecting with SMB1 for workgroup listing.
smbXcli_negprot_smb1_done: No compatible protocol selected by server.
Protocol negotiation to server 127.0.0.1 (for a protocol between NT1 and NT1) failed: NT_STATUS_INVALID_NETWORK_RESPONSE
Unable to connect with SMB1 -- no workgroup available
premier@ci7-230:~$ 

je pense qu'avec mes essais d'installation de ce que j'ai trouvé j'ai des lignes en trop dans smb.conf
comme l'histoire du NT1
Cordialement
dringdring

Hors ligne

#7 Le 04/05/2026, à 14:39

iznobe

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

smbclient

ne sert qu ' a montrer les partages effectifs sur une IP donnée .

Ce n ' est pas un ou le client samba .


on ne sais pas si sur la machine ou tu as passé la commande c ' est le serveur dont tu parles , toujours est il qu ' on voit bien qu ' un partage samba semble effectif en tout cas .
il semblerait que ce soit un partage SMBV1 aussi hmm


Si le serveur en question est la machine ubuntu , alors il ne devrait en aucun cas être : SMBV1 .

SMBV1 , est " réservé " a des machines qu  ' on ne peut pas mettre a niveau et qui ont plusieurs années ( donc pas un ordi ) .


mon smb.conf est plutôt standard :

iznobe@iznobe-PC-U26:~$ cat /etc/samba/smb.conf
#
# 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

# The NETBIOS service (nmbd) is obsolete for a long time.  By default it is
# disabled.  If you need this, comment out the following line, and ensure
# your system has at least one non-loopback network interface with IPv4 address.
   disable netbios = yes

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

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

# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
   logging = file

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

   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 = classic
# primary domain controller', 'server role = classic 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/useradd --create-home %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 config * :              backend = tdb
;   idmap config * :              range   = 3000-7999
;   idmap config YOURDOMAINHERE : backend = tdb
;   idmap config YOURDOMAINHERE : range   = 100000-999999
;   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 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

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

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make 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 = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# 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 so that their
# profile directory may be created the first time they log on
;[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/tmp
   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
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

[Vidéos]
    path = /Vidéos
    browseable = yes
    read only = yes
    valid users = @iznobe
    write list = @iznobe
    force user = iznobe
    force group = iznobe
    guest ok = no
    create mask = 0744
    directory mask = 0755

[Photos]
    path = /datas/iznobe/Photos
    browseable = yes
    read only = yes
    valid users = @iznobe
    write list = @iznobe
    force user = iznobe
    force group = iznobe
    guest ok = no
    create mask = 0744
    directory mask = 0755

[Musique]
    path = /datas/iznobe/Musique
    browseable = yes
    read only = yes
    valid users = @iznobe
    write list = @iznobe
    force user = iznobe
    force group = iznobe
    guest ok = no
    create mask = 0744
    directory mask = 0755

[Public]
    path = /datas/iznobe/Public
    browseable = yes
    read only = yes
    valid users = @iznobe
    write list = @iznobe
    force user = iznobe
    force group = iznobe
    guest ok = no
    create mask = 0640
    directory mask = 0750
iznobe@iznobe-PC-U26:~$ 

la seule chose modifiée / ajoutée , ce sont la config des partages .

un oubli hyper fréquent lors de la création d' un partage samba , c ' est la création du mot de passe samba pour l' utilisateur .
il n ' y a pas besoin de creer d ' utilisateur spécifique .


Et si tu veux absolument un partage samba , on peut essayer , mais pour cela il faut repartir sur une base saine roll

Dernière modification par iznobe (Le 04/05/2026, à 14:51)

Hors ligne

#8 Le 04/05/2026, à 14:52

dringdring

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

re iznobe
la machine sous ubuntu est effectivement le serveur.
les partages sont là :
DATA4To qui est le Disque entier en usb et un répertoire de celui ci "serveur" aussi partagé...

il semblerait que ce soit un partage SMBV1 aussi

c'est possible au vu du nombre d'essais infructueux que j'ai tenté , il se pourrait que j'ai installé des trucs non nécessaires voire néfastes.

cordialement Dringdring

Hors ligne

#9 Le 04/05/2026, à 15:05

dringdring

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

voici le mien de smb.conf

#
# 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
client min protocol = NT1

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

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

# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
   logging = file

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

   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 = classic
# primary domain controller', 'server role = classic 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/useradd --create-home %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 config * :              backend = tdb
;   idmap config * :              range   = 3000-7999
;   idmap config YOURDOMAINHERE : backend = tdb
;   idmap config YOURDOMAINHERE : range   = 100000-999999
;   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 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

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

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

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

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

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make 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 = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# 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 so that their
# profile directory may be created the first time they log on
;[profiles]
;   comment = Users profiles
;   path = /home/samba/profiles
;   guest ok = yes
;   browseable = yes
;   create mask = 0664
;   directory mask = 0775

[printers]
   comment = All Printers
   browseable = yes
   path = /var/tmp
   printable = yes
   guest ok = yes
   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 = yes
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

[DATA4To]
comment = DATA4To
path = /media/premier/DATA4To
browseable = yes
guest ok = yes
;public = yes
;force user= root
;writable = yes
read only = no
;create mask = 0664 
;directory mask = 0775

#[Nom du partage]
;path = /emplacement/du/répertoire
;guest ok = no
;browseable = yes
;read only = no

je me suis un peu emmêlé avec l'imprimante que je voulais partager aussi,(c'est plus accessoire)
le dernier nom de partage à la fin je l'ai mis à titre d'exemple pour moi
quant à serveur j'ai fait un partage via nautilus option de partage, mais il fait partie de DATA4To.

pour info que ce soit clair "serveur" est le nom d'un répertoire de DATA4To maintenant la machine qui doit être le serveur est bien celle ci sous ubuntu 24.04

Cordialement
dringdring

Dernière modification par dringdring (Le 04/05/2026, à 15:09)

Hors ligne

#10 Le 04/05/2026, à 15:17

iznobe

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

il faudrait remettre le smb.conf d ' origine , je suppose que tu ne l' as pas sauvegardé avant de le modifier ? ( et y ajouter le partage sans faire d ' autre modification )

Hors ligne

#11 Le 04/05/2026, à 15:22

iznobe

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

remplace tout le contenu du fichier smb.conf sur ton serveur par celui-ci :

#
# 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 is the equivalent of the NT Description field
   server string = %h server (Samba, Ubuntu)

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

# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
   logging = file

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

   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 = classic
# primary domain controller', 'server role = classic 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/useradd --create-home %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 config * :              backend = tdb
;   idmap config * :              range   = 3000-7999
;   idmap config YOURDOMAINHERE : backend = tdb
;   idmap config YOURDOMAINHERE : range   = 100000-999999
;   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 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

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

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make 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 = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# 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 so that their
# profile directory may be created the first time they log on
;[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/tmp
   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
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

[DATA4To]
comment = DATA4To
path = /media/premier/DATA4To
browseable = yes
guest ok = yes
;public = yes
;force user= root
;writable = yes
read only = no
;create mask = 0664 
;directory mask = 0775

#[Nom du partage]
;path = /emplacement/du/répertoire
;guest ok = no
;browseable = yes
;read only = no

donne ensuite :

sudo systemctl restart smbd
smbclient -L 127.0.0.1
apt policy samba
id

Dernière modification par iznobe (Le 04/05/2026, à 15:39)

Hors ligne

#12 Le 04/05/2026, à 15:29

dringdring

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

je pense que oui
j'avais juste supprimé quelques" ;" en tête de ligne que j'ai remis après
et j'ai nommé ce dernier fichier smbold.conf
voici ce qu'il donne:

#
# 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 is the equivalent of the NT Description field
   server string = %h server (Samba, Ubuntu)

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

# We want Samba to only log to /var/log/samba/log.{smbd,nmbd}.
# Append syslog@1 if you want important messages to be sent to syslog too.
   logging = file

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

   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 = classic
# primary domain controller', 'server role = classic 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/useradd --create-home %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 config * :              backend = tdb
;   idmap config * :              range   = 3000-7999
;   idmap config YOURDOMAINHERE : backend = tdb
;   idmap config YOURDOMAINHERE : range   = 100000-999999
;   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 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

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

# 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

# By default, \\server\username shares can be connected to by anyone
# with access to the samba server.
# Un-comment the following parameter to make 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 = /home/samba/netlogon
;   guest ok = yes
;   read only = yes

# 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 so that their
# profile directory may be created the first time they log on
;[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/tmp
   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
# Uncomment to allow remote administration of Windows print drivers.
# You may need to replace 'lpadmin' with the name of the group your
# admin users are members of.
# Please note that you also need to set appropriate Unix permissions
# to the drivers directory for these users to have write rights in it
;   write list = root, @lpadmin

plus de NT1 sous workgroup... plus de partage DATA4To...
maintenant j'ai ajouté un utilisateur sambauser
defini un mot de passe
puis défini un autre user premier avec aussi un mot de passe
je sais c'est un peu brouillon mais avec les différents posts wiki etc ce n'est pas évident..
Merci à toi iznobe

cordialement
dringdring

Hors ligne

#13 Le 04/05/2026, à 15:38

iznobe

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

tu as du ne pas voir mon dernier message.

Hors ligne

#14 Le 04/05/2026, à 15:40

dringdring

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

première commande:

premier@ci7-230:~$ sudo systemctl restart smbd
premier@ci7-230:~$ 

deuxième commande

premier@ci7-230:~$ smbclient -L 127.0.0.1
Password for [WORKGROUP\premier]:

	Sharename       Type      Comment
	---------       ----      -------
	print$          Disk      Printer Drivers
	DATA4To         Disk      
	IPC$            IPC       IPC Service (ci7-230 server (Samba, Ubuntu))
	Serveur         Disk      
SMB1 disabled -- no workgroup available
premier@ci7-230:~$ 

il m'a demandé un mot de passe pour workgroup??!!

troisième commande

premier@ci7-230:~$ apt policy samba
samba:
  Installé : 2:4.19.5+dfsg-4ubuntu9.4
  Candidat : 2:4.19.5+dfsg-4ubuntu9.4
 Table de version :
 *** 2:4.19.5+dfsg-4ubuntu9.4 500
        500 http://archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages
        500 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages
        100 /var/lib/dpkg/status
     2:4.19.5+dfsg-4ubuntu9 500
        500 http://archive.ubuntu.com/ubuntu noble/main amd64 Packages
premier@ci7-230:~$ 

voici
j'ai remplacé mon smb.conf par le tiens, nos messages se sont croisés! les résultats donnés sont ceux après remplacement du smb.conf

cordialement
dringdring

Dernière modification par dringdring (Le 04/05/2026, à 15:42)

Hors ligne

#15 Le 04/05/2026, à 15:55

iznobe

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

il m'a demandé un mot de passe pour workgroup??!!

ben voui , normal .


le partage a l ' air opérationnel et normal cette fois-ci .

Dernière modification par iznobe (Le 04/05/2026, à 16:02)

Hors ligne

#16 Le 04/05/2026, à 16:48

dringdring

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

Merci à toi iznobe

toutefois j'ai beau tenter de me connecter via l'autre ordi sous win11 il ne voit pas mon ordi ubuntu
et bien entendu pas les partages
soit en tant que premier ou en sambauser

alors que quand mon ordi était sous win 11  cela ne posait pas de problème :
partage du disque ou de serveur (dossier)...

quand je ping avec l'ordi w11 sur l'odi "serveur"ubuntu il le trouve...
adresse en exadécimal (ipv6) mais il le trouve!
(je ping sur le nom de la machine)

est-ce que cela aurait trait au formatage?
jusque là mon ubuntu lit et écrit le ntfs

dans smb.conf
quel role ;"force user"= root

Cordialement
dringdring

Hors ligne

#17 Le 04/05/2026, à 17:16

iznobe

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

le problème vient de ton ordi windobz maintenant .

il n' est pas correctement configuré pour voir le partage . lorsqu ' il le sera , alors tu pourras te connecté sans soucis .

PS : je n' y comprend rien en windobz . Mais lorsque j' avais fait ça sur l' ordi de ma femme , j ' avais du ajouter des composants de windobz pour samba , je me rappelle plus précisément , mais tu devrais pouvoir trouver sur le net au pire .

Hors ligne

#18 Le 04/05/2026, à 18:16

bonuscad

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

Peut être que iznobe fait allusion à:
Clic-droit sur l’icône démarrer de windows, choisir exécuter et taper dans l'invite la commande "optionalfeatures"
Vérifier si SMB est actif et au pire réactiver si besoin le SMB 1.0 mais FORTEMENT DÉCONSEILLE.

Dernière modification par bonuscad (Le 04/05/2026, à 18:17)

Hors ligne

#19 Le 04/05/2026, à 18:25

iznobe

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

je parle de ça : https://www.youtube.com/watch?v=yZBvhoWq0UQ
je ne sais pas si c' est pareil .

A 2min 47 de la vidéo , sur l' ordi de ma femme ( windobz 10 ) , il avait fallu , il me semble ajouter la fonctionnalité " SMB ( direct , c ' est pour win 11 ? ) " .
Et non , SMBV1 ne sert a rien dans ce cas ( on ne l ' utilise pas de toute maniére ) , et c' est effectivement très déconseillé de l ' activer sur windobz si ce n' est pas strictement nécessaire .

A la suite de quoi , il avait encore fallut faire des manips pour pouvoir acceder au partage samba de mon ordi , mais là je me rappelle plus trop , juste que c' est " ajouter un lecteur réseau " .

Dernière modification par iznobe (Le 04/05/2026, à 19:06)

Hors ligne

#20 Le 04/05/2026, à 18:41

bonuscad

Re : [à jamais irrésolu] samba partage simple? sous ubuntu 24.04

Oui c'est la même chose, par contre je crois que les options proposées peuvent être différente entre une version Familiale ou Pro de Windows, je n'ai qu'une version pro.

Hors ligne