Article 6E5G2 [SOLVED] smbclient -L broken

[SOLVED] smbclient -L broken

by
timsoft
from LinuxQuestions.org on (#6E5G2)
hi all. I have a script that checks samba is running by running
after checking `ps -A|grep smbd|wc -l` is greater than 0 and for files /var/run/smbd.pid and /var/run/nmdb.pid
Code:MYIP=`ifconfig|grep "inet "|head -n1|awk '{print $2}'`
echo `smbclient -g -L $MYIP -N 2>&1|grep "^Disk"|wc -l`
this should return a number >0 if one or more disk shares are being advertised on the local server.

it works fine on slackware64 14.2 (samba-4.6.16-2) but fails miserably on slackware64 15.0
running the smbclient line gives Quote:
Anonymous login successful
IPC|IPC$|IPC Service (Samba 4.15.5)
SMB1 disabled -- no workgroup available
so the -L option no longer works.

update. shortest post ever!.
solution
it appears that smbclient is using ip6 instead of ip4 for listing services. adding Quote:
fc00::/7 fe80::/64 fe02::c ::1
to the Code:hosts allow line in smb.conf appears to fix this (and fixes windows connecting without asking for passwords for guest shares)
External Content
Source RSS or Atom Feed
Feed Location https://feeds.feedburner.com/linuxquestions/latest
Feed Title LinuxQuestions.org
Feed Link https://www.linuxquestions.org/questions/
Reply 0 comments