#101 Le 25/07/2024, à 18:48
- RHERBIN
Re : Problême de partage de dossier
rherbin@RHERBIN:~/Bureau$ sudo umount /media/rherbin/DRIVEIMAGE/thinkcenter
rherbin@RHERBIN:~/Bureau$ sudo mount -t vfat UUID=3CC6-DC46 /media/rherbin/DRIVEIMAGE/thinkcenter -o rw,umask=000
rherbin@RHERBIN:~/Bureau$ sudo cat /etc/fstab
UUID=3CC6-DC46 /media/rherbin/DRIVEIMAGE/thinkcenter vfat defaults 0 2
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb5 during installation
UUID=9fbce91f-22d4-464c-9fbe-0e3425a28044 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sdb1 during installation
UUID=21DA-CB83 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
Dernière modification par RHERBIN (Le 25/07/2024, à 18:48)
Hors ligne
#102 Le 25/07/2024, à 18:48
- jplemoine
Re : Problême de partage de dossier
post #98 :
# /etc/fstab: static file system information.
Donc, il n'y aura pas le montage fait grâce à une ligne de commande...
Ce compte ne servira plus : vous pouvez le supprimer si le coeur vous en dit...
Laissé par l'auteur pour historique.
Hors ligne
#103 Le 25/07/2024, à 18:52
- iop_
Re : Problême de partage de dossier
Ok, dans un explorateur de fichiers va voir dans le dossier /media/rherbin/DRIVEIMAGE/thinkcenter. Tu devrais voir le contenu de ton disque dur... (Les 3 commandes précédentes ont réussi)
Dernière modification par iop_ (Le 25/07/2024, à 18:57)
Hors ligne
#104 Le 25/07/2024, à 19:06
- iop_
Re : Problême de partage de dossier
@jplemoine il faut que tu m'expliques ..
rherbin@RHERBIN:~/Bureau$ sudo umount /media/rherbin/DRIVEIMAGE/thinkcenter
rherbin@RHERBIN:~/Bureau$ sudo mount -t vfat UUID=3CC6-DC46 /media/rherbin/DRIVEIMAGE/thinkcenter -o rw,umask=000
rherbin@RHERBIN:~/Bureau$
Pour moi le disque est monté dans un premier temps et pour modifier fstab on verra pour modifier la ligne :
UUID=3CC6-DC46 /media/rherbin/DRIVEIMAGE/thinkcenter vfat defaults 0 2
Hors ligne
#105 Le 25/07/2024, à 19:30
- iop_
Re : Problême de partage de dossier
sudo fallocate -l 512M /exfat.img
[sudo] Mot de passe de user :
sudo mkfs.vfat /exfat.img
mkfs.fat 4.2 (2021-01-31)
sudo mkdir /mnt/fat
echo "/exfat.img /mnt/fat vfat default 0 2" | sudo tee -a /etc/fstab
/exfat.img /mnt/fat vfat defaults 0 2
sudo mount -a
touch /mnt/fat/test.txt
touch: impossible de faire un touch '/mnt/fat/test.txt': Permission non accordée
sudo umount /mnt/fat
umount: /mnt/fat: non monté.
sudo mount -t vfat /exfat.img /mnt/fat/ -o rw,umask=000
mount: (hint) your fstab has been modified, but systemd still uses
the old version; use 'systemctl daemon-reload' to reload.
touch /mnt/fat/test.txt
ls -l /mnt/fat/
total 0
-rwxrwxrwx 1 root root 0 juil. 25 20:26 test.txt
Dernière modification par iop_ (Le 25/07/2024, à 19:48)
Hors ligne
#106 Le 25/07/2024, à 19:32
- jplemoine
Re : Problême de partage de dossier
@jplemoine il faut que tu m'expliques ..
Il faut ? Certainement pas.
D'après le Larousse en ligne : "il faut indique une obligation, une nécessité".
Je n'ai fait que citer une ligne du fichier : après tu fais comme tu veux. J'en ai marre de recadrer la discussion (et donc la résolution).
Donc, ce sera désormais sans moi.
NB : Regarde le début de la discussion...
Ce compte ne servira plus : vous pouvez le supprimer si le coeur vous en dit...
Laissé par l'auteur pour historique.
Hors ligne
#107 Le 25/07/2024, à 19:35
- iop_
Re : Problême de partage de dossier
Désolé, je ne voulais pas froisser. Je ne dis plus rien
Hors ligne
#108 Le 26/07/2024, à 00:33
- tycooon
Re : Problême de partage de dossier
Bon, avec cette histoire je suis complètement embrouillé.
C'est vrai que je suis un très mauvais pédagogue, dans le paragraphe #81, c'est très mal expliqué et je m'en excuse.
je voulais montrer que l'on peut faire soit un montage manuel, soit automatique.
mais comme rherbin ne maîtrise pas la commande nano, je me suis dit laisse tomber on va la faire avec mkdir -p /media/$USER/... et mount.
De toute façon, c'est un disque interne on va le faire en automatique.
Dans son fichier /etc/fstab il a bien cette ligne :
!!cette ligne ci dessous n'a pas à être exécutée!! :
UUID=3CC6-DC46 /media/rherbin/DRIVEIMAGE/thinkcenter vfat defaults 0 2
je ne sais pas comment elle est arrivée, mais elle est bien là.
On va donc laisser tomber la méthode manuelle et on va faire tout en auto.
Si tout le monde est d'accord : on abandonne le montage manuel. On modifie la ligne ( on ajoute juste "umask=000") dans /etc/fstab, et comme la commande nano est compliquée, on va faire un sed. Pourquoi on rajoute "umask=000" ?? => le formatage vfat ne prend pas en charge les permissions et la gestion des propriétaires et des groupes. (d'ailleurs ce disque n'aurait jamais du être formaté en vfat) On va laisser tomber pour le moment (déjà que ca me prend la tête)
tu fais :
sudo sed -i '/^UUID=3CC6-DC46 /s/defaults/defaults,umask=000/' /etc/fstab
Tu reboot
On vérifie si la commande "sudo mkdir -p /media/rherbin/DRIVEIMAGE/thinkcenter" est bien passée (elle a du être passée) :
ls -l /media/rherbin/DRIVEIMAGE/thinkcenter
Et si le fichier fstab a bien été modifié
sudo cat /etc/fstab
Et on regarde ce qui se passe ?
tu vérifies si dans le gestionnaire de fichier ton disque est monté :
Dernière modification par tycooon (Le 26/07/2024, à 01:43)
Hors ligne
#109 Le 26/07/2024, à 09:41
- RHERBIN
Re : Problême de partage de dossier
sudo umount /media/rherbin/DRIVEIMAGE/thinkcenter
[sudo] Mot de passe de rherbin :
rherbin@RHERBIN:~/Bureau$ sudo mount -t vfat UUID=3CC6-DC46 /media/rherbin/DRIVEIMAGE/thinkcenter -o rw,umask=000
rherbin@RHERBIN:~/Bureau$ sudo cat /etc/fstab
UUID=3CC6-DC46 /media/rherbin/DRIVEIMAGE/thinkcenter vfat defaults 0 2
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb5 during installation
UUID=9fbce91f-22d4-464c-9fbe-0e3425a28044 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sdb1 during installation
UUID=21DA-CB83 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
Dernière modification par RHERBIN (Le 26/07/2024, à 09:42)
Hors ligne
#110 Le 26/07/2024, à 09:50
- RHERBIN
Re : Problême de partage de dossier
ls -l /media/rherbin/DRIVEIMAGE/thinkcenter
total 64
drwxrwxrwx 2 root root 32768 juin 16 11:37 'SAUVEGARDE SSD SAMSUNG'
drwxrwxrwx 2 root root 32768 juil. 20 10:04 THINKCENTER
rherbin@RHERBIN:~/Bureau$ sudo cat /etc/fstab
[sudo] Mot de passe de rherbin :
UUID=3CC6-DC46 /media/rherbin/DRIVEIMAGE/thinkcenter vfat defaults,umask=000 0 2
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb5 during installation
UUID=9fbce91f-22d4-464c-9fbe-0e3425a28044 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sdb1 during installation
UUID=21DA-CB83 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
Dernière modification par RHERBIN (Le 26/07/2024, à 09:51)
Hors ligne
#111 Le 26/07/2024, à 09:54
- RHERBIN
Re : Problême de partage de dossier
Lorsque je partage THINKCENTER j'obtiens une erreur pourtant le disque DRIVEIMAGE dans le gestionnaire de fichier est bien monté !
Hors ligne
#112 Le 26/07/2024, à 10:14
- tycooon
Re : Problême de partage de dossier
Erreur de permission ??
id rherbin
Hors ligne
#113 Le 26/07/2024, à 13:53
- RHERBIN
Re : Problême de partage de dossier
id rherbin
uid=1000(rherbin) gid=1000(rherbin) groupes=1000(rherbin),4(adm),24(cdrom),27(sudo),30(dip),46(plugdev),120(lpadmin),131(lxd),132(sambashare)
Dernière modification par RHERBIN (Le 26/07/2024, à 13:54)
Hors ligne
#114 Le 26/07/2024, à 13:57
- RHERBIN
Re : Problême de partage de dossier
Voici l'erreur que j'obtiens:
« net usershare » a retourné l'erreur 255 : [2024/07/26 14:54:38, 0] ../../lib/util/debug.c:1100(reopen_one_log)
reopen_one_log: Unable to open new log file 'THINKCENTER/log.net': Aucun fichier ou dossier de ce type
net usershare add: share name /media/rherbin/driveimage/thinkcenter/thinkcenter contains invalid characters (any of %<>*?|/\+=;:",)
Dernière modification par RHERBIN (Le 26/07/2024, à 13:57)
Hors ligne
#115 Le 26/07/2024, à 15:33
- tycooon
Re : Problême de partage de dossier
sudo sed -i '/^UUID=3CC6-DC46 /s/\(defaults\)/\1,uid=1000,gid=1000/' /etc/fstab
sudo mount -av
Reboot
tree -pug /mnt/
ls -l /media/rherbin/DRIVEIMAGE/thinkcenter
ls -la /var/lib/samba/usershares
groups
cat /etc/samba/smb.conf
Dernière modification par tycooon (Le 26/07/2024, à 16:48)
Hors ligne
#116 Le 26/07/2024, à 18:42
- RHERBIN
Re : Problême de partage de dossier
tree -pug /mnt/
locales-launch: Data of fr_FR locale not found, generating, please wait...
/mnt/ [error opening dir]
0 directories, 0 files
rherbin@RHERBIN:~/Bureau$ ls -l /media/rherbin/DRIVEIMAGE/thinkcenter
total 64
drwxrwxrwx 2 rherbin rherbin 32768 juin 16 11:37 'SAUVEGARDE SSD SAMSUNG'
drwxrwxrwx 2 rherbin rherbin 32768 juil. 20 10:04 THINKCENTER
rherbin@RHERBIN:~/Bureau$ ls -la /var/lib/samba/usershares
total 8
drwxrwx--T 2 root sambashare 4096 juil. 6 21:48 .
drwxr-xr-x 6 root root 4096 juil. 6 21:48 ..
rherbin@RHERBIN:~/Bureau$ groups
rherbin adm cdrom sudo dip plugdev lpadmin lxd sambashare
rherbin@RHERBIN:~/Bureau$ 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
# 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 = 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 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/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
# 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
Dernière modification par RHERBIN (Le 26/07/2024, à 18:43)
Hors ligne
#117 Le 26/07/2024, à 18:44
- RHERBIN
Re : Problême de partage de dossier
j'ai toujours la même erreur !
Hors ligne
#118 Le 26/07/2024, à 18:51
- xubu1957
Re : Problême de partage de dossier
Bonjour,
Merci de ne pas transmettre les réponses dans un seul bloc, mais 1 bloc de réponse par commande pour avoir de la visibilité
tree -pug /mnt/
locales-launch: Data of fr_FR locale not found, generating, please wait...
/mnt/ [error opening dir]
0 directories, 0 files
rherbin@RHERBIN:~/Bureau$ ls -l /media/rherbin/DRIVEIMAGE/thinkcenter
total 64
drwxrwxrwx 2 rherbin rherbin 32768 juin 16 11:37 'SAUVEGARDE SSD SAMSUNG'
drwxrwxrwx 2 rherbin rherbin 32768 juil. 20 10:04 THINKCENTER
rherbin@RHERBIN:~/Bureau$ ls -la /var/lib/samba/usershares
total 8
drwxrwx--T 2 root sambashare 4096 juil. 6 21:48 .
drwxr-xr-x 6 root root 4096 juil. 6 21:48 ..
rherbin@RHERBIN:~/Bureau$ groups
rherbin adm cdrom sudo dip plugdev lpadmin lxd sambashare
rherbin@RHERBIN:~/Bureau$ 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
# 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 = 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 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/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
# 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
Bonjour,
Quand il y a plusieurs retours de commandes ..., il est préférable de les poster dans le même message (au besoin en utilisant le lien « Modifier »), ça évite d'alourdir la discussion.
Dernière modification par xubu1957 (Le 26/07/2024, à 21:46)
Conseils pour les nouveaux demandeurs et pas qu'eux
Important : Pensez à passer vos sujets en [Réso|u] lorsque ceux-ci le sont, au début du titre en cliquant sur Modifier sous le premier message, et un bref récapitulatif de la solution à la fin de celui-ci. Merci. Membre de Linux-Azur
Hors ligne
#119 Le 26/07/2024, à 21:27
- tycooon
Re : Problême de partage de dossier
tu oublies souvent le retour des commandes que je te donnes
cela ne me facilite pas la tache.
Le disque doit est monté, on va s'occuper du partage :
cat << EOF | sudo tee -a /etc/samba/smb.conf
[thinkcenter]
path = /media/rherbin/DRIVEIMAGE/thinkcenter
available = yes
browsable = yes
public = yes
writable = yes
guest ok = yes
create mask = 0666
directory mask = 0777
EOF
sudo usermod -aG sambashare $USER
sudo smbpasswd -a rherbin
Tu tapes le mot de passe qui est le même que ton système
tu reboot
Après le reboot :
sudo cat /etc/fstab
sudo testparm -s
ls -lR /mnt/
ls -lR /var/lib/samba
lsblk -fe7 | cat
hostnamectl
ls -l /etc/samba/
find /mnt/ -print0 | xargs -0 getfacl
grep thinkcenter /etc/mtab
find ~ -ipath "*.*" ! -user $USER -exec ls -ld {} \;
ip a
Dernière modification par tycooon (Le 26/07/2024, à 23:56)
Hors ligne
#120 Le 27/07/2024, à 09:40
- RHERBIN
Re : Problême de partage de dossier
cat << EOF | sudo tee -a /etc/samba/smb.conf
> [thinkcenter]
> path = /media/rherbin/DRIVEIMAGE/thinkcenter
> available = yes
> browsable = yes
> public = yes
> writable = yes
> guest ok = yes
> create mask = 0666
> directory mask = 0777
> EOF
[sudo] Mot de passe de rherbin :
[thinkcenter]
path = /media/rherbin/DRIVEIMAGE/thinkcenter
available = yes
browsable = yes
public = yes
writable = yes
guest ok = yes
create mask = 0666
directory mask = 0777
Dernière modification par RHERBIN (Le 27/07/2024, à 09:40)
Hors ligne
#121 Le 27/07/2024, à 09:46
- RHERBIN
Re : Problême de partage de dossier
sudo cat /etc/fstab
[sudo] Mot de passe de rherbin :
UUID=3CC6-DC46 /media/rherbin/DRIVEIMAGE/thinkcenter vfat defaults,uid=1000,gid=1000,umask=000 0 2
# /etc/fstab: static file system information.
#
# Use 'blkid' to print the universally unique identifier for a
# device; this may be used with UUID= as a more robust way to name devices
# that works even if disks are added and removed. See fstab(5).
#
# <file system> <mount point> <type> <options> <dump> <pass>
# / was on /dev/sdb5 during installation
UUID=9fbce91f-22d4-464c-9fbe-0e3425a28044 / ext4 errors=remount-ro 0 1
# /boot/efi was on /dev/sdb1 during installation
UUID=21DA-CB83 /boot/efi vfat umask=0077 0 1
/swapfile none swap sw 0 0
Dernière modification par RHERBIN (Le 27/07/2024, à 09:46)
Hors ligne
#122 Le 27/07/2024, à 09:47
- RHERBIN
Re : Problême de partage de dossier
sudo testparm -s
Load smb config files from /etc/samba/smb.conf
Loaded services file OK.
Weak crypto is allowed
Server role: ROLE_STANDALONE
# Global parameters
[global]
log file = /var/log/samba/log.%m
logging = file
map to guest = Bad User
max log size = 1000
obey pam restrictions = Yes
pam password change = Yes
panic action = /usr/share/samba/panic-action %d
passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
passwd program = /usr/bin/passwd %u
server role = standalone server
server string = %h server (Samba, Ubuntu)
unix password sync = Yes
usershare allow guests = Yes
idmap config * : backend = tdb
[printers]
browseable = No
comment = All Printers
create mask = 0700
path = /var/spool/samba
printable = Yes
[print$]
comment = Printer Drivers
path = /var/lib/samba/printers
[thinkcenter]
create mask = 0666
directory mask = 0777
guest ok = Yes
path = /media/rherbin/DRIVEIMAGE/thinkcenter
read only = No
Dernière modification par RHERBIN (Le 27/07/2024, à 09:48)
Hors ligne
#123 Le 27/07/2024, à 09:49
- RHERBIN
Re : Problême de partage de dossier
ls -lR /mnt/
/mnt/:
total 0
Dernière modification par RHERBIN (Le 27/07/2024, à 09:49)
Hors ligne
#124 Le 27/07/2024, à 09:51
- RHERBIN
Re : Problême de partage de dossier
ls -lR /var/lib/samba
/var/lib/samba:
total 1360
-rw------- 1 root root 421888 juil. 6 21:48 account_policy.tdb
drwxr-xr-x 4 root root 4096 juil. 6 21:48 DriverStore
-rw------- 1 root root 696 juil. 6 21:48 group_mapping.tdb
drwxr-xr-x 12 root root 4096 juil. 6 21:48 printers
drwxr-xr-x 4 root root 4096 juil. 8 17:30 private
-rw------- 1 root root 528384 juil. 6 21:48 registry.tdb
-rw------- 1 root root 421888 juil. 6 21:48 share_info.tdb
drwxrwx--T 2 root sambashare 4096 juil. 6 21:48 usershares
/var/lib/samba/DriverStore:
total 8
drwxr-xr-x 2 root root 4096 juil. 6 21:48 FileRepository
drwxr-xr-x 2 root root 4096 juil. 6 21:48 Temp
/var/lib/samba/DriverStore/FileRepository:
total 0
/var/lib/samba/DriverStore/Temp:
total 0
/var/lib/samba/printers:
total 40
drwxr-xr-x 2 root root 4096 juil. 6 21:48 ARM64
drwxr-xr-x 2 root root 4096 juil. 6 21:48 color
drwxr-xr-x 2 root root 4096 oct. 11 2023 COLOR
drwxr-xr-x 2 root root 4096 oct. 11 2023 IA64
drwxr-xr-x 2 root root 4096 oct. 11 2023 W32ALPHA
drwxr-xr-x 2 root root 4096 oct. 11 2023 W32MIPS
drwxr-xr-x 2 root root 4096 oct. 11 2023 W32PPC
drwxr-xr-x 3 root root 4096 juil. 6 21:48 W32X86
drwxr-xr-x 2 root root 4096 oct. 11 2023 WIN40
drwxr-xr-x 3 root root 4096 juil. 6 21:48 x64
/var/lib/samba/printers/ARM64:
total 0
/var/lib/samba/printers/color:
total 0
/var/lib/samba/printers/COLOR:
total 0
/var/lib/samba/printers/IA64:
total 0
/var/lib/samba/printers/W32ALPHA:
total 0
/var/lib/samba/printers/W32MIPS:
total 0
/var/lib/samba/printers/W32PPC:
total 0
/var/lib/samba/printers/W32X86:
total 4
drwxr-xr-x 2 root root 4096 juil. 6 21:48 PCC
/var/lib/samba/printers/W32X86/PCC:
total 0
/var/lib/samba/printers/WIN40:
total 0
/var/lib/samba/printers/x64:
total 4
drwxr-xr-x 2 root root 4096 juil. 6 21:48 PCC
/var/lib/samba/printers/x64/PCC:
total 0
/var/lib/samba/private:
total 840
drwx------ 2 root root 4096 juil. 27 10:43 msg.sock
-rw------- 1 root root 421888 juil. 27 10:42 passdb.tdb
-rw------- 1 root root 430080 juil. 6 21:48 secrets.tdb
drwxr-xr-x 2 root root 4096 juil. 8 17:30 smbd.tmp
ls: impossible d'ouvrir le répertoire '/var/lib/samba/private/msg.sock': Permission non accordée
/var/lib/samba/private/smbd.tmp:
total 0
/var/lib/samba/usershares:
total 0
Dernière modification par RHERBIN (Le 27/07/2024, à 09:51)
Hors ligne
#125 Le 27/07/2024, à 09:53
- RHERBIN
Re : Problême de partage de dossier
lsblk -fe7 | cat
NAME FSTYPE LABEL UUID FSAVAIL FSUSE% MOUNTPOINT
sda
├─sda1 vfat 21DA-CB83 511M 0% /boot/efi
├─sda2
└─sda5 ext4 9fbce91f-22d4-464c-9fbe-0e3425a28044 183,9G 14% /
sdb vfat DRIVEIMAGE 3CC6-DC46 930,8G 0% /media/rherbin/DRIVEIMAGE/thinkcenter
sr0
Dernière modification par RHERBIN (Le 27/07/2024, à 09:53)
Hors ligne