You are here: Foswiki>KnowledgeBase Web>AboutSamba (14 Apr 2020, AggelikiAnagnostopoulou)Edit Attach
SambaTesting
Created Δευτέρα 24 Απρίλιος 2017
MoveToFossWiki
see also https://wiki.samba.org/index.php/Troubleshooting_Samba_Domain_Members
see also https://wiki.samba.org/index.php/Samba_Member_Server_Troubleshooting

### From a client test TCP connectivity
nmap -p139,445 $HOST|grep open # both ports should be open

### On the Samba server
# test if config is OK
testparm -s | head
# check service status
systemctl status smb.service # or smbd
# view open files
smbstatus
# view latest logs
find /var/log/samba -type f -size +1c -mmin -1|xargs -i bash -c 'echo {}; tail -5 {}|grep -v "^ *$"'
# tail -f /var/log/samba/log.smbd
tail -f /var/log/samba/log.smbd | grep --line-buffered -v 'JSON auth logs not\|log_no_json\|Processing section\|param.loadparm\|^\['|grep --line-buffered 'NT_[A-Z_]*\|$'

### On a windows client
ping ServerName
net view \\ServerName
net use P: "\\ServerName\ShareName" /persistent:no
# -or-
net use P: \\ServerName\ShareName SuperSecretPass /user:DomainName\UserName
# -or-
net use P: \\ServerName\ShareName SuperSecretPass /user:DomainName\UserName /savecred /p:yes
# finaly un-map the drive letter from the share
net use P: /delete

### On the samba server or on a client
smbclient -L 10.1.2.3 -U% # try a guest login
smbclient -L hostname -I 10.1.2.3 -U administrator 
...
	Sharename       Type      Comment
	---------       ----      -------
	shared          Disk      
	IPC$            IPC       IPC Service (Samba 4.4.4)

smbclient //10.1.2.3/shared -U administrator 
Anonymous login successful
Domain=[WORKGROUP] OS=[Windows 6.1] Server=[Samba 4.4.4]
smb: \> ls
  .                                   D        0  Mon Apr 24 16:51:11 2017
  ..                                 DR        0  Wed Apr 12 14:28:35 2017
  a-file                                      22  Sun Apr 23 01:16:49 2017

smb: \> get a-file
getting file \a-file of size 22 as a-file (10.7 KiloBytes/sec) (average 7.2 KiloBytes/sec)

#### e.g. for rock @ dimopoulos
smbclient -L 192.168.32.2 -U% # try a guest login
smbclient -L 192.168.32.2 -U administrator  # try with administrator account
smbclient //192.168.32.2/ergotaxio -U administrator 

### other commands to troubleshoot

#### smbtree
smbtree - A text based smb network browser

	   -D|--domains
		   Only print a list of all the domains known on broadcast or by the master browser
	   -S|--servers
		   Only print a list of all the domains and servers responding on broadcast or known by the master
		   browser.
	   -dn |--debuglevel=n (3 is detailed)

	   -k|--kerberos
		   Try to authenticate with kerberos. Only useful in an Active Directory environment.

	   -N|--no-pass

	   -U|--user=username[%password]


##### Example: smbtree -N -d3
lp_load_ex: refreshing parameters
Initialising global parameters
rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
Processing section "[global]"
added interface eth1 ip=192.168.0.163 bcast=192.168.0.255 netmask=255.255.255.0
resolve_lmhosts: Attempting lmhosts lookup for name METRO<0x1d>  <---domain name
name_resolve_bcast: Attempting broadcast lookup for name METRO<0x1d>
Got a positive name query response from 192.168.0.142 ( 192.168.0.142 )
Connecting to host=192.168.0.142
Connecting to host=192.168.0.142
Connecting to 192.168.0.142 at port 445
Doing spnego session setup (blob length=16)
server didn't supply a full spnego negprot
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
name_resolve_bcast: Attempting broadcast lookup for name MSBROWSE<0x1>
Got a positive name query response from 192.168.0.142 ( 192.168.0.142 )
Connecting to host=192.168.0.142
Connecting to 192.168.0.142 at port 445
Doing spnego session setup (blob length=16)
server didn't supply a full spnego negprot
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
METRO
Connecting to host=192.168.0.142
Connecting to 192.168.0.142 at port 445
Doing spnego session setup (blob length=16)
server didn't supply a full spnego negprot
Got challenge flags:
Got NTLMSSP neg_flags=0x628a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
		\\OFFICE                        %office
Connecting to host=OFFICE
resolve_lmhosts: Attempting lmhosts lookup for name OFFICE<0x20>
resolve_wins: Attempting wins lookup for name OFFICE<0x20>
resolve_wins: WINS server resolution selected and no WINS servers listed.
resolve_hosts: Attempting host lookup for name OFFICE<0x20>
Connecting to 192.168.0.163 at port 445
Doing spnego session setup (blob length=58)
got OID=1.3.6.1.4.1.311.2.2.10
got principal=NONE
Got challenge flags:
Got NTLMSSP neg_flags=0x608a8215
NTLMSSP: Set final flags:
Got NTLMSSP neg_flags=0x60088215
NTLMSSP Sign/Seal - Initialising with flags:
Got NTLMSSP neg_flags=0x60088215
SPNEGO login failed: Logon failure
				\\OFFICE\LEXMARKE120n           LEXMARK E120
				\\OFFICE\HP_Photosmart_C5200_series     HP Photosmart C5200 series
				\\OFFICE\Cups-PDF               Cups-PDF
				\\OFFICE\IPC$                   IPC Service (%office)
				\\OFFICE\print$





Topic revision: r1 - 14 Apr 2020, AggelikiAnagnostopoulou
Copyright © enLogic