J'ai des difficultés à comprendre pourquoi cela ne fonctionne pas chez vous.
Voici mon fichier de configuration samba :
Code : Tout sélectionner
[global]
# ==================== #
# Identification #
# ==================== #
workgroup = constellations
server string = %h - Samba %v
public = no
# ------------------ #
# #
# ------------------ #
netbios name = RaspberryPi
wins support = yes
# ---------------- #
# Networking #
# ---------------- #
interfaces = 127.0.0.0/8 eth0 wlan0
bind interfaces only = yes
# -------------------- #
# Authentication #
# -------------------- #
security = user
server role = standalone server
passdb backend = tdbsam
obey pam restrictions = yes
# ------------------- #
# Miscellaneous #
# ------------------- #
usershare max shares = 0
usershare allow guests = no
# ======================= #
# Share Definitions #
# ======================= #
[share]
comment = Partage Samba sur Raspberry Pi
path = /share
read only = no
writeable = yes
valid users = root pi
guest ok = no
[public]
comment = Partage Samba tout Public
path = /share
read only = yes
writeable = no
guest ok = yes
C'est un paramètre que je ne comprends pas trop son utilité. Pourquoi ?
Parce que la connexion se fait en précisant l'adresse ip et le nom de partage.
Le nom de partage doit exister et c'est lui qui indique comment les accès vont se faire.
Sous windows, pour me connecter, je fais :
Code : Tout sélectionner
\\192.168.1.99\share
Quand je suis dans le répertoire, sous windows, je peux créer, modifier, supprimer et exécuter un fichier.
Bien sûr, l'exécution ne peut être que du genre "lancer.bat".
Ou bien :
Code : Tout sélectionner
\\192.168.1.99\public
Par contre, windows m'interdit l'exécution de ce batch.
Comme vous êtes sous raspbian, pour la connexion distante, je fais de même afin de vérifier si cela fonctionne aussi.
J'installe ceci :
Code : Tout sélectionner
sudo apt-get install smbclient cifs-utils
Code : Tout sélectionner
~> smbclient //192.168.1.99/share --user=root --max-protocol=smb3
Unable to initialize messaging context
Enter CONSTELLATIONS\root's password:
Try "help" to get a list of possible commands.
smb: \> dir
. D 0 Thu Dec 17 09:15:59 2020
.. D 0 Wed Dec 16 16:58:57 2020
lancer.bat N 39 Thu Dec 17 09:15:59 2020
lost+found D 0 Tue Dec 8 07:56:15 2020
hello.txt A 21 Wed Dec 9 07:59:49 2020
102687672 blocks of size 1024. 97366932 blocks available
smb: \> quit
~>
~>
Code : Tout sélectionner
~> smbclient //192.168.1.99/share
Unable to initialize messaging context
Enter CONSTELLATIONS\pi's password:
Try "help" to get a list of possible commands.
smb: \> dir
. D 0 Thu Dec 17 09:15:59 2020
.. D 0 Wed Dec 16 16:58:57 2020
lancer.bat N 39 Thu Dec 17 09:15:59 2020
lost+found D 0 Tue Dec 8 07:56:15 2020
hello.txt A 21 Wed Dec 9 07:59:49 2020
102687672 blocks of size 1024. 97366932 blocks available
smb: \> quit
~>
Code : Tout sélectionner
~> smbclient -L //192.168.1.99/share
Unable to initialize messaging context
Enter CONSTELLATIONS\pi's password:
Sharename Type Comment
--------- ---- -------
share Disk Partage Samba sur Raspberry Pi
public Disk Partage Samba tout Public
IPC$ IPC IPC Service (RaspberryPi - Samba 4.9.5-Debian)
Reconnecting with SMB1 for workgroup listing.
Server Comment
--------- -------
Workgroup Master
--------- -------
CONSTELLATIONS RASPBERRYPI
~>
Code : Tout sélectionner
/share> testparm -L
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Registered MSG_REQ_POOL_USAGE
Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
Load smb config files from /etc/samba/smb.conf
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[share]"
Processing section "[public]"
Loaded services file OK.
Server role: ROLE_STANDALONE
Press enter to see a dump of your service definitions
# Global parameters
[global]
bind interfaces only = Yes
interfaces = 127.0.0.0/8 eth0 wlan0
obey pam restrictions = Yes
security = USER
server role = standalone server
server string = %h - Samba %v
usershare max shares = 0
wins support = Yes
workgroup = CONSTELLATIONS
idmap config * : backend = tdb
[share]
comment = Partage Samba sur Raspberry Pi
path = /share
read only = No
valid users = root pi
[public]
comment = Partage Samba tout Public
guest ok = Yes
path = /share
/share>
/share>
/share> smbtree
CONSTELLATIONS
\\RASPBERRYPI RaspberryPi - Samba 4.9.5-Debian
\\RASPBERRYPI\IPC$ IPC Service (RaspberryPi - Samba 4.9.5-Debian)
\\RASPBERRYPI\public Partage Samba tout Public
\\RASPBERRYPI\share Partage Samba sur Raspberry Pi
\\ORION Orion
/share>
@+