[ 已解决 ]samba4 netbios 问题

如题,升级了 opensuse 13.1,samba 也升级到了 4.x,但是有个问题就是 samba4 下的 netbios 似乎不工作,在 windows 的网络位置找不到 samba 共享,用
etbios name 访问也不行,但是用 ip 访问是可以的。google 了好多类似的问题,无果,想问下,samba4 的 netbios 应该如何配置才能在 windows 的网络位置找到 samba 共享?
贴下 smb.conf:

# smb.conf is the main Samba configuration file. You find a full commented
# version at /usr/share/doc/packages/samba/examples/smb.conf.SUSE if the
# samba-doc package is installed.
[global]
	add machine script = /usr/sbin/useradd  -c Machine -d /var/lib/nobody -s /bin/false %m$
	interfaces = eth0
	security = user
	printing = cups
	getwd cache = yes
	printcap cache time = 750
	map hidden = Yes
	printer name = Photosmart-7400-series
	map system = Yes
	log file = /var/log/samba/%m.log
	map to guest = Bad User
	include = /etc/samba/dhcp.conf
	wide links = Yes
	netbios name = HOME-Server
	unix extensions = No
	cups options = raw
	browseable = Yes
	usershare allow guests = No
	logon drive = P:
	logon path = \%Lprofiles.msprofile
	printer = Photosmart-7400-series
	os level = 65
	wins support = Yes
	printcap name = cups
	name resolve order = bcast wins lmhosts hosts
	socket options = IPTOS_LOWDELAY TCP_NODELAY SO_RCVBUF=16384 SO_SNDBUF=16384
	guest account = nobody
	logon home = \%L\%U.9xprofile
	passdb backend = tdbsam
	default = NAS
	follow symlinks = Yes
	workgroup = WORKGROUP
	
## Share disabled by YaST
# [homes]
#	comment = Home Directories
#	valid users = %S, %D%w%S
#	browseable = No
#	read only = No
#	inherit acls = Yes

## Share disabled by YaST
# [profiles]
#	comment = Network Profiles Service
#	path = %H
#	read only = No
#	store dos attributes = Yes
#	create mask = 0600
#	directory mask = 0700

## Share disabled by YaST
# [users]
#	comment = All users
#	path = /home
#	read only = No
#	inherit acls = Yes
#	veto files = /aquota.user/groups/shares/

## Share disabled by YaST
# [groups]
#	comment = All groups
#	path = /home/groups
#	read only = No
#	inherit acls = Yes

[printers]
	comment = All Printers
	path = /var/tmp
	printable = Yes
	create mask = 0600
	browseable = Yes
	guest ok = Yes

[print$]
	comment = Printer Drivers
	path = /var/lib/samba/drivers
	write list = @ntadmin root
	force group = ntadmin
	create mask = 0664
	directory mask = 0775

## Share disabled by YaST
# [netlogon]

[NAS]
	map system = Yes
	browseable = Yes
	guest ok = Yes
	comment = HOME Files Sharing
	inherit acls = Yes
	path = /NAS
	read only = No
	map hidden = Yes
	writable = Yes
	create mode = 0777
	directory mode = 0777
	create mask = 0777
	directory mask = 0777

最终发现是卡巴斯基 2014 防火墙把 137,138 端口阻止导致的问题,打开这两个端口,问题顺利解决。。。

@wacke 没太看懂,你的 openSUSE 是 Samba 服务器,用 Windows 访问它,地址栏输入 netbios 不行?是这样吗?

光看 config 没太大用处。samba 在 /var/log/samba 下有日志的,你用 Windows 再访问一遍,然后查日志看错误消息。

来自 Galaxy Note 2 上的 Tapatalk 4

就是在 windows 下,使用设置的 netbios 名称无法访问共享,但是直接用 ip 地址访问是可以的,在 windows 的网络里面也不会显示 samba 共享,以前 3.x 的时候是可以的,升级了 4.x 就不行了,怎么配置都不行,查了好多资料,也没找到解决方法,还有个奇怪的地方是,在黑苹果下面是可以发现 samba 共享的,唯独 windows 下面不行。。。

没看明白,一直用 yast2 设置这类杂七杂八的东西

Sent from my GT-N7100 using Tapatalk

用截图来说吧,我把 netbios 名设置为 HOME-Server,在 windows 下打开运行,输入 HOME-Server,会出现如下界面:
,但是在运行对话框里面直接输入 opensuse 的 ip 地址就能打开 samba 共享的文件夹,在 12.3 的 samba 3.x 下,没有这个问题的,在 windows 的计算机文件夹左侧的网络列表里面也能发现 netbios 名称,感觉这个问题应该还是 samba4.x 的 netbios 有问题…

我现在明白了你的场景。你怀疑是 samba 4.x 的 netbios 有问题,你要提供 samba server 在 openSUSE 上的日志。你用 Windows 访问 openSUSE,服务器端会有记录和错误消息。提供 Windows 截图没啥用,我们不可能到 Widnows 上去调试 openSUSE 问题。。。

用ip随便访问了下,loglevel设置为3,nmbd.log如下:

[2013/12/09 09:38:20,  0] ../source3/nmbd/nmbd.c:902(main)
  nmbd version 4.1.2-5.2-3126-SUSE-oS13.1-x86_64 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2013
[2013/12/09 09:38:20,  3] ../lib/util/params.c:550(pm_process)
  params.c:pm_process() - Processing configuration file "/etc/samba/dhcp.conf"
[2013/12/09 09:38:20,  2] ../source3/lib/tallocmsg.c:124(register_msg_pool_usage)
  Registered MSG_REQ_POOL_USAGE
[2013/12/09 09:38:20,  2] ../source3/lib/dmallocmsg.c:78(register_dmalloc_msgs)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2013/12/09 09:38:20,  3] ../source3/param/loadparm.c:4838(lp_load_ex)
  lp_load_ex: refreshing parameters
[2013/12/09 09:38:20,  3] ../source3/param/loadparm.c:750(init_globals)
  Initialising global parameters
[2013/12/09 09:38:20,  2] ../source3/param/loadparm.c:543(max_open_files)
  rlimit_max: increasing rlimit_max (1024) to minimum Windows limit (16384)
[2013/12/09 09:38:20,  3] ../lib/util/params.c:550(pm_process)
  params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
[2013/12/09 09:38:20,  3] ../source3/param/loadparm.c:3564(do_section)
  Processing section "[global]"
[2013/12/09 09:38:20,  3] ../lib/util/params.c:550(pm_process)
  params.c:pm_process() - Processing configuration file "/etc/samba/dhcp.conf"
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd.c:413(reload_nmbd_services)
  services not loaded
[2013/12/09 09:38:20,  0] ../source3/nmbd/nmbd.c:941(main)
  standard input is not a socket, assuming -D option
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd.c:946(main)
  Becoming a daemon.
[2013/12/09 09:38:20,  0] ../source3/nmbd/asyncdns.c:157(start_async_dns)
  started asyncdns process 18712
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd.c:1035(main)
  Opening sockets 137
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd.c:763(open_sockets)
  open_sockets: Broadcast sockets opened.
[2013/12/09 09:38:20,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:2ded:67cd:8214:5d72 bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:20,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:3285:a9ff:feae:7bb6 bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:20,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:5d8b:87e1:aa99:9d4 bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:20,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:6002:93df:8939:1e13 bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:20,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:7940:7ad:3223:730f bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:20,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=192.168.1.2 bcast=192.168.1.255 netmask=255.255.255.0
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd_subnetdb.c:180(make_subnet)
  making subnet name:192.168.1.2 Broadcast address:192.168.1.255 Subnet mask:255.255.255.0
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd_subnetdb.c:297(create_subnets)
  create_subnets: ignoring non IPv4 interface.
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd_subnetdb.c:297(create_subnets)
  create_subnets: ignoring non IPv4 interface.
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd_subnetdb.c:297(create_subnets)
  create_subnets: ignoring non IPv4 interface.
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd_subnetdb.c:297(create_subnets)
  create_subnets: ignoring non IPv4 interface.
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd_subnetdb.c:297(create_subnets)
  create_subnets: ignoring non IPv4 interface.
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd_subnetdb.c:180(make_subnet)
  making subnet name:UNICAST_SUBNET Broadcast address:192.168.1.2 Subnet mask:192.168.1.2
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd_subnetdb.c:180(make_subnet)
  making subnet name:REMOTE_BROADCAST_SUBNET Broadcast address:0.0.0.0 Subnet mask:0.0.0.0
[2013/12/09 09:38:20,  2] ../source3/nmbd/nmbd_subnetdb.c:180(make_subnet)
  making subnet name:WINS_SERVER_SUBNET Broadcast address:0.0.0.0 Subnet mask:0.0.0.0
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name LOCALHOST<00> with first IP 127.0.0.1 ttl=0 nb_flags= 4 to subnet REMOTE_BROADCAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name LOCALHOST<20> with first IP 127.0.0.1 ttl=0 nb_flags= 4 to subnet REMOTE_BROADCAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd.c:1057(main)
  Loaded hosts file /etc/samba/lmhosts
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-SERVER<20> with first IP 192.168.1.2 ttl=258601 nb_flags=66 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name WORKGROUP<1e> with first IP 0.0.0.0 ttl=258601 nb_flags=e4 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-PC<00> with first IP 192.168.1.3 ttl=250915 nb_flags=64 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-PC<20> with first IP 192.168.1.3 ttl=250916 nb_flags=64 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name WORKGROUP<00> with first IP 0.0.0.0 ttl=258601 nb_flags=e4 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __MSBROWSE__<01> with first IP 0.0.0.0 ttl=251404 nb_flags=e4 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-SERVER<03> with first IP 192.168.1.2 ttl=258601 nb_flags=66 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-SERVER<00> with first IP 192.168.1.2 ttl=258601 nb_flags=66 to subnet WINS_SERVER_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_serverlistdb.c:134(create_server_on_workgroup)
  create_server_on_workgroup: Created server entry HOME-SERVER of type 40819a03 (Samba 4.1.2-5.2-3126-SUSE-oS13.1-x86_64) on workgroup WORKGROUP.
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_workgroupdb.c:259(initiate_myworkgroup_startup)
  initiate_myworkgroup_startup: Added server name entry HOME-SERVER on subnet 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-SERVER<20> with first IP 192.168.1.2 ttl=259200 nb_flags=64 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-SERVER<03> with first IP 192.168.1.2 ttl=259200 nb_flags=64 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-SERVER<00> with first IP 192.168.1.2 ttl=259200 nb_flags=64 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name WORKGROUP<00> with first IP 192.168.1.2 ttl=259200 nb_flags=e4 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name WORKGROUP<1e> with first IP 192.168.1.2 ttl=259200 nb_flags=e4 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_serverlistdb.c:134(create_server_on_workgroup)
  create_server_on_workgroup: Created server entry HOME-SERVER of type 40819a03 (Samba 4.1.2-5.2-3126-SUSE-oS13.1-x86_64) on workgroup WORKGROUP.
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_workgroupdb.c:259(initiate_myworkgroup_startup)
  initiate_myworkgroup_startup: Added server name entry HOME-SERVER on subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet UNICAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet REMOTE_BROADCAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name *<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet REMOTE_BROADCAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet REMOTE_BROADCAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __SAMBA__<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet REMOTE_BROADCAST_SUBNET
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_sendannounce.c:212(send_host_announcement)
  send_host_announcement: type 819a03 for host HOME-SERVER on subnet 192.168.1.2 for workgroup WORKGROUP
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_winsserver.c:1648(wins_process_multihomed_name_registration_request)
  wins_process_multihomed_name_registration_request: name registration for name HOME-SERVER<20> IP 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_winsserver.c:1648(wins_process_multihomed_name_registration_request)
  wins_process_multihomed_name_registration_request: name registration for name HOME-SERVER<03> IP 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_winsserver.c:1648(wins_process_multihomed_name_registration_request)
  wins_process_multihomed_name_registration_request: name registration for name HOME-SERVER<00> IP 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_winsserver.c:1186(wins_process_name_registration_request)
  wins_process_name_registration_request: Group name registration for name WORKGROUP<00> IP 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_winsserver.c:1270(wins_process_name_registration_request)
  wins_process_name_registration_request: Adding IP 0.0.0.0 to group name WORKGROUP<00>.
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_winsserver.c:1186(wins_process_name_registration_request)
  wins_process_name_registration_request: Group name registration for name WORKGROUP<1e> IP 192.168.1.2
[2013/12/09 09:38:20,  3] ../source3/nmbd/nmbd_winsserver.c:1270(wins_process_name_registration_request)
  wins_process_name_registration_request: Adding IP 0.0.0.0 to group name WORKGROUP<1e>.
[2013/12/09 09:38:24,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-SERVER<20> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet 192.168.1.2
[2013/12/09 09:38:24,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-SERVER<03> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet 192.168.1.2
[2013/12/09 09:38:24,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name HOME-SERVER<00> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet 192.168.1.2
[2013/12/09 09:38:24,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name WORKGROUP<00> with first IP 192.168.1.2 ttl=0 nb_flags=e0 to subnet 192.168.1.2
[2013/12/09 09:38:24,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name WORKGROUP<1e> with first IP 192.168.1.2 ttl=0 nb_flags=e0 to subnet 192.168.1.2
[2013/12/09 09:38:24,  2] ../source3/nmbd/nmbd_elections.c:112(check_for_master_browser_fail)
  check_for_master_browser_fail: Forcing election on workgroup WORKGROUP subnet 192.168.1.2
[2013/12/09 09:38:24,  3] ../source3/nmbd/nmbd_elections.c:369(check_elections)
  check_elections: >>> Starting election for workgroup WORKGROUP on subnet 192.168.1.2 <<<
[2013/12/09 09:38:26,  3] ../source3/nmbd/nmbd_serverlistdb.c:401(write_browse_list)
  write_browse_list: Wrote browse list into file /var/cache/samba/browse.dat
[2013/12/09 09:38:26,  2] ../source3/nmbd/nmbd_nameregister.c:193(wins_registration_timeout)
  wins_registration_timeout: WINS server 127.0.0.1 timed out registering IP 192.168.1.2
[2013/12/09 09:38:26,  2] ../source3/nmbd/nmbd_nameregister.c:193(wins_registration_timeout)
  wins_registration_timeout: WINS server 127.0.0.1 timed out registering IP 192.168.1.2
[2013/12/09 09:38:26,  2] ../source3/nmbd/nmbd_nameregister.c:193(wins_registration_timeout)
  wins_registration_timeout: WINS server 127.0.0.1 timed out registering IP 192.168.1.2
[2013/12/09 09:38:26,  2] ../source3/nmbd/nmbd_nameregister.c:193(wins_registration_timeout)
  wins_registration_timeout: WINS server 127.0.0.1 timed out registering IP 192.168.1.2
[2013/12/09 09:38:26,  2] ../source3/nmbd/nmbd_nameregister.c:193(wins_registration_timeout)
  wins_registration_timeout: WINS server 127.0.0.1 timed out registering IP 192.168.1.2
[2013/12/09 09:38:27,  2] ../source3/nmbd/nmbd_elections.c:42(send_election_dgram)
  send_election_dgram: Sending election packet for workgroup WORKGROUP on subnet 192.168.1.2
[2013/12/09 09:38:29,  2] ../source3/nmbd/nmbd_elections.c:42(send_election_dgram)
  send_election_dgram: Sending election packet for workgroup WORKGROUP on subnet 192.168.1.2
[2013/12/09 09:38:31,  2] ../source3/nmbd/nmbd_elections.c:42(send_election_dgram)
  send_election_dgram: Sending election packet for workgroup WORKGROUP on subnet 192.168.1.2
[2013/12/09 09:38:33,  2] ../source3/nmbd/nmbd_elections.c:42(send_election_dgram)
  send_election_dgram: Sending election packet for workgroup WORKGROUP on subnet 192.168.1.2
[2013/12/09 09:38:35,  2] ../source3/nmbd/nmbd_elections.c:42(send_election_dgram)
  send_election_dgram: Sending election packet for workgroup WORKGROUP on subnet 192.168.1.2
[2013/12/09 09:38:35,  2] ../source3/nmbd/nmbd_elections.c:205(run_elections)
  run_elections: >>> Won election for workgroup WORKGROUP on subnet 192.168.1.2 <<<
[2013/12/09 09:38:35,  2] ../source3/nmbd/nmbd_become_lmb.c:538(become_local_master_browser)
  become_local_master_browser: Starting to become a master browser for workgroup WORKGROUP on subnet 192.168.1.2
[2013/12/09 09:38:35,  3] ../source3/nmbd/nmbd_become_lmb.c:540(become_local_master_browser)
  become_local_master_browser: first stage - attempt to register ^1^2__MSBROWSE__^2^1
[2013/12/09 09:38:35,  3] ../source3/nmbd/nmbd_serverlistdb.c:401(write_browse_list)
  write_browse_list: Wrote browse list into file /var/cache/samba/browse.dat
[2013/12/09 09:38:39,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __MSBROWSE__<01> with first IP 192.168.1.2 ttl=0 nb_flags=e0 to subnet 192.168.1.2
[2013/12/09 09:38:39,  3] ../source3/nmbd/nmbd_become_lmb.c:453(become_local_master_stage1)
  become_local_master_stage1: go to stage 2: register the WORKGROUP<1d> name.
[2013/12/09 09:38:39,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name __MSBROWSE__<01> with first IP 192.168.1.2 ttl=0 nb_flags=e0 to subnet UNICAST_SUBNET
[2013/12/09 09:38:43,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name WORKGROUP<1d> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet 192.168.1.2
[2013/12/09 09:38:43,  3] ../source3/nmbd/nmbd_become_lmb.c:354(become_local_master_stage2)
  become_local_master_stage2: registered as master browser for workgroup WORKGROUP on subnet 192.168.1.2
[2013/12/09 09:38:43,  3] ../source3/nmbd/nmbd_sendannounce.c:70(broadcast_announce_request)
  broadcast_announce_request: sending announce request for workgroup WORKGROUP to subnet 192.168.1.2
[2013/12/09 09:38:43,  3] ../source3/nmbd/nmbd_namelistdb.c:263(add_name_to_subnet)
  add_name_to_subnet: Added netbios name WORKGROUP<1d> with first IP 192.168.1.2 ttl=0 nb_flags=60 to subnet UNICAST_SUBNET
[2013/12/09 09:38:43,  0] ../source3/nmbd/nmbd_become_lmb.c:397(become_local_master_stage2)
  *****
  
  Samba name server HOME-SERVER is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.2
  
  *****
[2013/12/09 09:38:43,  3] ../source3/nmbd/nmbd_sendannounce.c:170(send_local_master_announcement)
  send_local_master_announcement: type 849a03 for name HOME-SERVER on subnet 192.168.1.2 for workgroup WORKGROUP
[2013/12/09 09:38:43,  3] ../source3/nmbd/nmbd_sendannounce.c:189(send_workgroup_announcement)
  send_workgroup_announcement: on subnet 192.168.1.2 for workgroup WORKGROUP
[2013/12/09 09:38:43,  3] ../source3/nmbd/nmbd_winsserver.c:2033(wins_process_name_query_request)
  wins_process_name_query: name query for name WORKGROUP<1b> from IP 192.168.1.2
[2013/12/09 09:38:43,  0] ../source3/nmbd/nmbd_browsesync.c:354(find_domain_master_name_query_fail)
  find_domain_master_name_query_fail:
  Unable to find the Domain Master Browser name WORKGROUP<1b> for the workgroup WORKGROUP.
  Unable to sync browse lists in this workgroup.
[2013/12/09 09:38:46,  3] ../source3/nmbd/nmbd_serverlistdb.c:401(write_browse_list)
  write_browse_list: Wrote browse list into file /var/cache/samba/browse.dat

smbd的log如下:

[2013/12/09 09:38:18,  0] ../source3/smbd/server.c:1198(main)
  smbd version 4.1.2-5.2-3126-SUSE-oS13.1-x86_64 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2013
[2013/12/09 09:38:18,  3] ../lib/util/params.c:550(pm_process)
  params.c:pm_process() - Processing configuration file "/etc/samba/dhcp.conf"
[2013/12/09 09:38:18,  2] ../source3/lib/tallocmsg.c:124(register_msg_pool_usage)
  Registered MSG_REQ_POOL_USAGE
[2013/12/09 09:38:18,  2] ../source3/lib/dmallocmsg.c:78(register_dmalloc_msgs)
  Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED
[2013/12/09 09:38:18.743089,  3] ../source3/param/loadparm.c:4838(lp_load_ex)
  lp_load_ex: refreshing parameters
[2013/12/09 09:38:18.743130,  3] ../source3/param/loadparm.c:750(init_globals)
  Initialising global parameters
[2013/12/09 09:38:18.743179,  3] ../lib/util/params.c:550(pm_process)
  params.c:pm_process() - Processing configuration file "/etc/samba/smb.conf"
[2013/12/09 09:38:18.743209,  3] ../source3/param/loadparm.c:3564(do_section)
  Processing section "[global]"
[2013/12/09 09:38:18.743311,  3] ../lib/util/params.c:550(pm_process)
  params.c:pm_process() - Processing configuration file "/etc/samba/dhcp.conf"
[2013/12/09 09:38:18.743442,  2] ../source3/param/loadparm.c:3581(do_section)
  Processing section "[printers]"
[2013/12/09 09:38:18.743535,  2] ../source3/param/loadparm.c:3581(do_section)
  Processing section "[print$]"
[2013/12/09 09:38:18.743601,  2] ../source3/param/loadparm.c:3581(do_section)
  Processing section "[NAS]"
[2013/12/09 09:38:18.743708,  3] ../source3/param/loadparm.c:1773(lp_add_ipc)
  adding IPC service
[2013/12/09 09:38:18.743853,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:2ded:67cd:8214:5d72 bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:18.743902,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:3285:a9ff:feae:7bb6 bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:18.743934,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:5d8b:87e1:aa99:9d4 bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:18.743964,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:6002:93df:8939:1e13 bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:18.743993,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=2001:470:19:120c:7940:7ad:3223:730f bcast= netmask=ffff:ffff:ffff:ffff::
[2013/12/09 09:38:18.744022,  2] ../source3/lib/interface.c:341(add_interface)
  added interface eth0 ip=192.168.1.2 bcast=192.168.1.255 netmask=255.255.255.0
[2013/12/09 09:38:18.744074,  3] ../source3/smbd/server.c:1257(main)
  loaded services
[2013/12/09 09:38:18.744174,  0] ../source3/smbd/server.c:1278(main)
  standard input is not a socket, assuming -D option
[2013/12/09 09:38:18.744233,  3] ../source3/smbd/server.c:1289(main)
  Becoming a daemon.
[2013/12/09 09:38:18.745567,  2] ../source3/passdb/pdb_interface.c:159(make_pdb_method_name)
  No builtin backend found, trying to load plugin
[2013/12/09 09:38:18.746374,  2] ../lib/util/modules.c:191(do_smb_load_module)
  Module 'tdbsam' loaded
[2013/12/09 09:38:18.749158,  3] ../source3/auth/token_util.c:439(finalize_local_nt_token)
  Failed to fetch domain sid for WORKGROUP
[2013/12/09 09:38:18.749242,  3] ../source3/auth/token_util.c:470(finalize_local_nt_token)
  Failed to fetch domain sid for WORKGROUP
[2013/12/09 09:38:18.749826,  3] ../source3/rpc_server/svcctl/srv_svcctl_reg.c:565(svcctl_init_winreg)
  Initialise the svcctl registry keys if needed.
[2013/12/09 09:38:18.751679,  3] ../source3/rpc_server/eventlog/srv_eventlog_reg.c:59(eventlog_init_winreg)
  Initialise the eventlog registry keys if needed.
[2013/12/09 09:38:18.752131,  3] ../source3/printing/queue_process.c:242(start_background_queue)
  start_background_queue: Starting background LPQ thread
[2013/12/09 09:38:18.752887,  1] ../source3/printing/printer_list.c:225(printer_list_get_last_refresh)
  Failed to fetch record!
[2013/12/09 09:38:18.752956,  2] ../source3/smbd/server.c:938(smbd_parent_loop)
  waiting for connections
[2013/12/09 09:38:18.753408,  3] ../source3/printing/pcap.c:138(pcap_cache_reload)
  reloading printcap cache
[2013/12/09 09:38:18.754181,  3] ../source3/printing/pcap.c:189(pcap_cache_reload)
  reload status: ok
[2013/12/09 09:38:18.757399,  3] ../source3/param/loadparm.c:1810(lp_add_printer)
  adding printer service Photosmart-7400-series
[2013/12/09 09:38:18.757981,  2] ../source3/rpc_client/cli_winreg_spoolss.c:626(winreg_create_printer)
  winreg_create_printer: Skipping, SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Photosmart-7400-series already exists
[2013/12/09 09:38:18.758460,  3] ../source3/param/loadparm.c:1810(lp_add_printer)
  adding printer service Photosmart-7400-series
[2013/12/09 09:38:18.758838,  2] ../source3/rpc_client/cli_winreg_spoolss.c:626(winreg_create_printer)
  winreg_create_printer: Skipping, SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Photosmart-7400-series already exists
[2013/12/09 09:39:18.800758,  2] ../source3/smbd/server.c:437(remove_child_pid)
  Could not find child 18726 -- ignoring
[2013/12/09 09:39:18.811966,  3] ../source3/printing/queue_process.c:76(print_queue_housekeeping)
  Printcap cache time expired.
[2013/12/09 09:39:18.812068,  3] ../source3/printing/pcap.c:138(pcap_cache_reload)
  reloading printcap cache
[2013/12/09 09:39:18.812630,  3] ../source3/printing/pcap.c:189(pcap_cache_reload)
  reload status: ok
[2013/12/09 09:39:18.816288,  2] ../source3/rpc_client/cli_winreg_spoolss.c:626(winreg_create_printer)
  winreg_create_printer: Skipping, SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Photosmart-7400-series already exists
[2013/12/09 09:39:18.816843,  2] ../source3/rpc_client/cli_winreg_spoolss.c:626(winreg_create_printer)
  winreg_create_printer: Skipping, SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Photosmart-7400-series already exists
[2013/12/09 09:40:18.857733,  2] ../source3/smbd/server.c:437(remove_child_pid)
  Could not find child 18736 -- ignoring
[2013/12/09 09:41:18.919222,  2] ../source3/smbd/server.c:437(remove_child_pid)
  Could not find child 18744 -- ignoring

@wacke 可是你用 ip 访问不是没问题的嘛。。。你要提供:在 Windows 上用 NetBIOS 访问 openSUSE Samba 时,openSUSE 下的相应日志。因为:

  1. 要是 Windows 下的 NetBIOS 连接请求发不出去,openSUSE 这边就不会有日志。这时要用另一个 Linux 计算机来试,要是 NetBIOS 能访问,那就是 Windows 问题修不了。不然就是你 NetBIOS 没配好。

  2. 要是请求发出去了,openSUSE 处理不了,那就有日志。根据日志就能知道为什么处理不了。

来自 Galaxy Note 2 上的 Tapatalk 4

用 HOME-Server 这个访问,samba server 似乎有反应的,截取了一段 nmbd 的 log:

  *****
  
  Samba name server HOME-SERVER is now a local master browser for workgroup WORKGROUP on subnet 192.168.1.2
  
  *****
[2013/12/09 13:13:30,  3] ../source3/nmbd/nmbd_sendannounce.c:170(send_local_master_announcement)
  send_local_master_announcement: type 849a03 for name HOME-SERVER on subnet 192.168.1.2 for workgroup WORKGROUP
[2013/12/09 13:13:30,  3] ../source3/nmbd/nmbd_sendannounce.c:189(send_workgroup_announcement)
  send_workgroup_announcement: on subnet 192.168.1.2 for workgroup WORKGROUP
[2013/12/09 13:13:30,  3] ../source3/nmbd/nmbd_winsserver.c:2033(wins_process_name_query_request)
  wins_process_name_query: name query for name WORKGROUP<1b> from IP 192.168.1.2
[2013/12/09 13:13:30,  0] ../source3/nmbd/nmbd_browsesync.c:354(find_domain_master_name_query_fail)
  find_domain_master_name_query_fail:
  Unable to find the Domain Master Browser name WORKGROUP<1b> for the workgroup WORKGROUP.
  Unable to sync browse lists in this workgroup.
[2013/12/09 13:13:32,  3] ../source3/nmbd/nmbd_serverlistdb.c:401(write_browse_list)
  write_browse_list: Wrote browse list into file /var/cache/samba/browse.dat
[2013/12/09 13:13:39,  3] ../source3/nmbd/nmbd_incomingdgrams.c:218(process_workgroup_announce)
  process_workgroup_announce: from HOME-PC<00> IP 192.168.1.3 to __MSBROWSE__<01> for workgroup WORKGROUP.
[2013/12/09 13:13:39,  3] ../source3/nmbd/nmbd_serverlistdb.c:401(write_browse_list)
  write_browse_list: Wrote browse list into file /var/cache/samba/browse.dat
[2013/12/09 13:14:02,  3] ../source3/nmbd/nmbd_incomingrequests.c:459(process_name_query_request)
  process_name_query_request: Name query from 192.168.1.3 on subnet 192.168.1.2 for name HOME-SERVER<20>
[2013/12/09 13:14:02,  3] ../source3/nmbd/nmbd_incomingrequests.c:574(process_name_query_request)
  OK
[2013/12/09 13:14:03,  3] ../source3/nmbd/nmbd_incomingrequests.c:459(process_name_query_request)
  process_name_query_request: Name query from 192.168.1.3 on subnet 192.168.1.2 for name HOME-SERVER<20>
[2013/12/09 13:14:03,  3] ../source3/nmbd/nmbd_incomingrequests.c:574(process_name_query_request)
  OK
[2013/12/09 13:14:03,  3] ../source3/nmbd/nmbd_incomingrequests.c:459(process_name_query_request)
  process_name_query_request: Name query from 192.168.1.3 on subnet 192.168.1.2 for name HOME-SERVER<20>
[2013/12/09 13:14:03,  3] ../source3/nmbd/nmbd_incomingrequests.c:574(process_name_query_request)
  OK
[2013/12/09 13:14:03,  3] ../source3/nmbd/nmbd_incomingrequests.c:459(process_name_query_request)
  process_name_query_request: Name query from 192.168.1.3 on subnet 192.168.1.2 for name HOME-SERVER<20>
[2013/12/09 13:14:03,  3] ../source3/nmbd/nmbd_incomingrequests.c:574(process_name_query_request)
  OK
[2013/12/09 13:14:03,  3] ../source3/nmbd/nmbd_incomingrequests.c:459(process_name_query_request)
  process_name_query_request: Name query from 192.168.1.3 on subnet 192.168.1.2 for name HOME-SERVER<20>
[2013/12/09 13:14:03,  3] ../source3/nmbd/nmbd_incomingrequests.c:574(process_name_query_request)
  OK

再次修改提高 log level 后,仔细查看 nmbd 的 log,发现 nmbd 有向网络里发送 netbios 的广播消息,以及 netbios 的名称查询返回消息,然后就开始往 windows 防火墙方面考虑,因为装了 2014 版卡巴斯基的安全套装,就先把 137 卡巴斯基退出,再用 HOME-Server 访问,毫无延迟的打开了共享文件夹,至此终于确定是卡巴斯基防火墙问题, 打开卡巴斯基,进入防火墙配置界面,发现卡巴斯基把 137,138 端口接受方向默认设置为阻止,坑啊。。。因为之前一直正常的,一直都没有往防火墙上面考虑,因为这个问题纠结了好久,终于解决了。。。

对于 samba 这种东西,我情愿用 ftp 来替代。

ftp 跟 samba 是二樣東西