Pas vraiment "pointu" sur la gestion de l'outil SAMBA, je bloque sur un problème de résolution de nom avec serveur Samba...
Il s'agit pourtant d'une configuration standard qui a fonctionné plusieurs mois sans problème.
Tous mes partages Samba fonctionnent depuis un client Windows uniquement si j'ouvre une session depuis l'adresse IP du serveur Samba
net use \\10.60.1.125 --> OK
net use \\srv-eldshare-01 --> KO[/list]
En résumé:
- ping et nslookup depuis mon client windows --> serveur Samba: ok sur IP et hostname
- ping et nslookup depuis mon serveur samba --> client windows: ok sur IP et hostname
- Les 2 machines sont déclarées sur le DNS Windows --> ELDOADS01 - 10.60.1.100
- Une session smbclient lancée depuis un poste Linux sur le serveur Linux samba fonctionne sur l'IP ET le hostname
- Une ouverture du gestionnaire de fichiers windows lancée (depuis le client windows...) sur le serveur samba fonctionne sur l'IP --> \\10.60.1.125
- Une ouverture du gestionnaire de fichiers windows lancée (depuis le client windows...) sur le serveur samba NE FONCTIONNE PAS sur le hostname --> \\srv-eldshare-01
https://www.linuxquestions.org/question ... ng-859870/
https://ubuntuforums.org/showthread.php?t=2222941
Ma config actuelle (les partages fonctionnent depuis windows, sur IP mais pas sur hostname)
Connectivité réseau
Code : Tout sélectionner
C:\Windows\system32>nslookup srv-eldshare-01
Server: eldoads03.MON_RESEAU.local
Address: 10.60.1.102
Name: srv-eldshare-01.MON_RESEAU.local
Address: 10.60.1.125
C:\Windows\system32>nslookup 10.60.1.125
Server: eldoads03.MON_RESEAU.local
Address: 10.60.1.102
Name: srv-eldshare-01.MON_RESEAU.local
Address: 10.60.1.125
C:\Windows\system32>ping 10.60.1.125
Pinging 10.60.1.125 with 32 bytes of data:
Reply from 10.60.1.125: bytes=32 time=4ms TTL=64
Reply from 10.60.1.125: bytes=32 time=2ms TTL=64
Ping statistics for 10.60.1.125:
Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 4ms, Average = 3ms
Control-C
^C
C:\Windows\system32>ping srv-eldshare-01
Pinging SRV-ELDSHARE-01.MON_RESEAU.local [10.60.1.125] with 32 bytes of data:
Reply from 10.60.1.125: bytes=32 time=2ms TTL=64
Reply from 10.60.1.125: bytes=32 time=2ms TTL=64
Ping statistics for 10.60.1.125:
Packets: Sent = 2, Received = 2, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 2ms, Maximum = 2ms, Average = 2ms
Control-C
^C
C:\Windows\system32>
Code : Tout sélectionner
[root@srv-eldshare-01 samba]# cat smb.conf
[global]
#workgroup = MON_RESEAU
workgroup = TEST
#
server string = Samba Server %v
netbios name = SRV-ELDSHARE-01
#name resolve order = lmhosts wins host bcast
name resolve order = bcast host lmhosts wins
security = user
guest account = nobody
map to guest = bad user
hosts allow = ALL
wins support = yes
#name resolve order = lmhosts
#wins server = 10.60.1.100
#local master = yes
#preferred master = yes
#dns proxy = yes
#usershare allow guests = yes
#hosts allow = 10.60.0.59
#interfaces = ens160 10.60.1.125/24
interfaces = ens160 lo
log file = /var/log/samba/log.%m
...
Code : Tout sélectionner
C:\Windows\system32>net view \\10.60.1.125
Shared resources at \\10.60.1.125
Samba Server 4.8.3
Share name Type Used as Comment
-------------------------------------------------
altella Disk
cerfi Disk
cut Disk
EXPORT_DL Disk
FTPEtab Disk
PKS_MERCURIA Disk
poste_prod Disk
poste_test Disk
SCRT Disk
The command completed successfully.
C:\Windows\system32>
C:\Windows\system32>net view \\srv-eldshare-01
System error 53 has occurred.
The network path was not found.
C:\Windows\system32>
L'accès depuis un client Linux fonctionne
Code : Tout sélectionner
root@centos7-test ~]# smbclient -L srv-eldshare-01 -N
Sharename Type Comment
--------- ---- -------
altella Disk
cerfi Disk
cut Disk
PKS_MERCURIA Disk
SCRT Disk
FTPEtab Disk
poste_test Disk
poste_prod Disk
EXPORT_DL Disk
IPC$ IPC IPC Service (Samba Server 4.8.3)
Reconnecting with SMB1 for workgroup listing.
Server Comment
--------- -------
Workgroup Master
--------- -------
MON_RESEAU DSR-H2O
TEST SRV-ELDSHARE-01
[root@centos7-test ~]#
par contre, il détecte aussi "MON_RESEAU" qui plus est sur le serveur "DSR-H20" qui n'est même pas censé être ni un serveur SAMBA ni un domain controller.
Accès depuis le serveur Samba lui-même
Code : Tout sélectionner
[root@srv-eldshare-01 samba]# smbclient -L srv-eldshare-01 -N
...
[root@srv-eldshare-01 samba]# smbclient -L localhost -N
Donc de linux à linux, la résolution de nom est ok
smbtree en mode debug
Visualise d'abord mon Workgroup "TEST" et liste correctement les shares, mais ensuite essaie de se connecter sur un serveur nommé "DSR-H20", qui n'est ni un serveur SAMBA ni un contrôleur de domaine par contre il s'agit d'un vieux serveur NT 2003 tout pourri...
Code : Tout sélectionner
[root@srv-eldshare-01 samba]# smbtree -d3
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
Processing section "[global]"
added interface ens160 ip=10.60.1.125 bcast=10.60.1.255 netmask=255.255.254.0
added interface lo ip=127.0.0.1 bcast=127.255.255.255 netmask=255.0.0.0
Connecting to 10.60.1.125 at port 445
got OID=1.3.6.1.4.1.311.2.2.10
GENSEC backend 'gssapi_spnego' registered
GENSEC backend 'gssapi_krb5' registered
GENSEC backend 'gssapi_krb5_sasl' registered
GENSEC backend 'spnego' registered
GENSEC backend 'schannel' registered
GENSEC backend 'naclrpc_as_system' registered
GENSEC backend 'sasl-EXTERNAL' registered
GENSEC backend 'ntlmssp' registered
GENSEC backend 'ntlmssp_resume_ccache' registered
GENSEC backend 'http_basic' registered
GENSEC backend 'http_ntlm' registered
GENSEC backend 'http_negotiate' registered
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62008215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62008215
TEST
Connecting to 10.60.1.125 at port 445
got OID=1.3.6.1.4.1.311.2.2.10
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62008215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62008215
\\SRV-ELDSHARE-01 Samba Server 4.8.3
Connecting to 10.60.1.125 at port 445
got OID=1.3.6.1.4.1.311.2.2.10
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62008215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62008215
\\SRV-ELDSHARE-01\IPC$ IPC Service (Samba Server 4.8.3)
\\SRV-ELDSHARE-01\EXPORT_DL
\\SRV-ELDSHARE-01\poste_prod
\\SRV-ELDSHARE-01\poste_test
\\SRV-ELDSHARE-01\FTPEtab
\\SRV-ELDSHARE-01\SCRT
\\SRV-ELDSHARE-01\PKS_MERCURIA
\\SRV-ELDSHARE-01\cut
\\SRV-ELDSHARE-01\cerfi
\\SRV-ELDSHARE-01\altella
MON_RESEAU
Connecting to 10.60.1.32 at port 445
got OID=1.2.840.48018.1.2.2
Got challenge flags:
Got NTLMSSP neg_flags=0x62898215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62008215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62008215
SPNEGO login failed: The attempted logon is invalid. This is either due to a bad username or authentication information.
got OID=1.2.840.48018.1.2.2
Got challenge flags:
Got NTLMSSP neg_flags=0x62898215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62008a15
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62008a15
SPNEGO login failed: An invalid parameter was passed to a service or function.
Connecting to 10.60.1.32 at port 445
got OID=1.2.840.48018.1.2.2
Got challenge flags:
Got NTLMSSP neg_flags=0x62898215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62008215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62008215
SPNEGO login failed: The attempted logon is invalid. This is either due to a bad username or authentication information.
got OID=1.2.840.48018.1.2.2
Got challenge flags:
Got NTLMSSP neg_flags=0x62898215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x62008a15
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x62008a15
SPNEGO login failed: An invalid parameter was passed to a service or function.
[root@srv-eldshare-01 samba]#
J'aimerais que mon serveur samba puisse faire la résolution de nom sur mon serveur de domaine: 10.60.1.100 et arrête d'essayer de se connecter sur 10.60.1.32... avec un bad username.
SELinux
Est en mode "Permissive"
Code : Tout sélectionner
[root@srv-eldshare-01 samba]# sestatus
SELinux status: enabled
SELinuxfs mount: /sys/fs/selinux
SELinux root directory: /etc/selinux
Loaded policy name: targeted
Current mode: permissive
Mode from config file: permissive
Policy MLS status: enabled
Policy deny_unknown status: allowed
Max kernel policy version: 31
[root@srv-eldshare-01 samba]#
Ceci dit, j'ai ouvert pour Samba:
Code : Tout sélectionner
[root@srv-eldshare-01 samba]# setsebool -P samba_export_all_ro=1 samba_export_all_rw=1
[root@srv-eldshare-01 samba]# getsebool -a | grep samba_export
samba_export_all_ro --> on
samba_export_all_rw --> on
[root@srv-eldshare-01 samba]#
Je sèche lamentablement depuis hier... Auriez-vous une idée comment faire ?
Merci d'avance pour toute suggestion et bonne fin de journée à vous.
Jean