解决Samba服务无法访问 网络名不再可用的问题,生活中无法解决的问题
[KylinShare] path=/opt/Share available = yes read only = no valid users = root, sean browsable = yes public = yes writable = yes. smbpasswd -a root 添加用户,service smbd restart 重启samba服务。在Win10上打开资源管理器,在地址栏输入:\\\\192.168.0.205,可以看到KylinShare文件夹,但是双击访问KylinShare时却提示没有权限访问或者指定的网络名不再可用 。百度来百度去,翻来覆去就是以上几条原因,各种尝试折腾了半天,始终不行。talloc: access after free error – first free may be at ../source3/smbd/open.c:4026 [2019/10/10 03:51:11.787821, ?Bad talloc magic value – access after free [2019/10/10 03:51:11.787827, ?
问题描述
新建虚拟机,安装ubuntukylin-14.04.2-desktop-amd64系统
配置IP地址为:192.168.0.205
然后apt-get安装samba,编辑 /etc/samba/smb.conf?
[KylinShare]
path=/opt/Share
available = yes
read only = no
valid users = root, sean
browsable = yes
public = yes
writable = yes
smbpasswd -a root 添加用户,service smbd restart 重启samba服务
在Win10上打开资源管理器,在地址栏输入:\\\\192.168.0.205,可以看到KylinShare文件夹,
但是双击访问KylinShare时却提示没有权限访问或者指定的网络名不再可用
。
?
解决过程
首先怀疑是防火墙的问题,卸载iptables,不行
百度了一下,有说是SELinux的问题,确保SELinux状态是disabled,还是不行
chmod 777 /opt/Share设置目录权限,照样不行
netstat -ntlp 看了下端口号,139和445都在,确定通信是没有问题的
还有说smb.conf配置有问题的,可是同样的配置在Ubuntu14.04上完全正常,见了鬼了
百度来百度去,翻来覆去就是以上几条原因,各种尝试折腾了半天,始终不行。
最后通过查看 /var/log/samba/下的日志文件发现以下内容
[2019/10/10 03:51:11.787782, ?0] ../source3/lib/popt_common.c:68(popt_s3_talloc_log_fn)
? talloc: access after free error – first free may be at ../source3/smbd/open.c:4026
[2019/10/10 03:51:11.787821, ?0] ../source3/lib/popt_common.c:68(popt_s3_talloc_log_fn)
? Bad talloc magic value – access after free
[2019/10/10 03:51:11.787827, ?0] ../source3/lib/util.c:789(smb_panic_s3)
? PANIC (pid 3206): Bad talloc magic value – access after free
[2019/10/10 03:51:11.799969, ?0] ../source3/lib/util.c:900(log_stack_trace)
? BACKTRACE: 34 stack frames:
? ?#0 /usr/lib/x86_64-linux-gnu/samba/libsmbregistry.so.0(log_stack_trace+0x1a) [0x7f3f251431da]
? ?#1 /usr/lib/x86_64-linux-gnu/samba/libsmbregistry.so.0(smb_panic_s3+0x20) [0x7f3f251432b0]
? ?#2 /usr/lib/x86_64-linux-gnu/libsamba-util.so.0(smb_panic+0x2f) [0x7f3f25eba8df]
? ?#3 /usr/lib/x86_64-linux-gnu/libtalloc.so.2(+0x1b5f) [0x7f3f22c41b5f]
? ?#4 /usr/lib/x86_64-linux-gnu/libtalloc.so.2(_talloc_steal_loc+0xab) [0x7f3f22c4877b]
? ?#5 /usr/lib/x86_64-linux-gnu/libtalloc.so.2(_talloc_move+0x13) [0x7f3f22c487b3]
? ?#6 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(+0x18b408) [0x7f3f25afc408]
? ?#7 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(+0x18b811) [0x7f3f25afc811]
? ?#8 /usr/lib/x86_64-linux-gnu/samba/libdbwrap.so.0(+0x51ed) [0x7f3f201071ed]
? ?#9 /usr/lib/x86_64-linux-gnu/libtdb.so.1(+0x8745) [0x7f3f1ceb4745]
? ?#10 /usr/lib/x86_64-linux-gnu/libtdb.so.1(tdb_parse_record+0x6c) [0x7f3f1ceafedc]
? ?#11 /usr/lib/x86_64-linux-gnu/samba/libdbwrap.so.0(+0x5559) [0x7f3f20107559]
? ?#12 /usr/lib/x86_64-linux-gnu/samba/libdbwrap.so.0(dbwrap_parse_record+0x1b) [0x7f3f20104dbb]
? ?#13 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(fetch_share_mode_unlocked+0x54) [0x7f3f25afd484]
? ?#14 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(get_file_infos+0x60) [0x7f3f25af6450]
? ?#15 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(smbd_dirptr_get_entry+0x738) [0x7f3f25a1f188]
? ?#16 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(smbd_dirptr_lanman2_entry+0x1c5) [0x7f3f25a53095]
? ?#17 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(+0x140fc0) [0x7f3f25ab1fc0]
? ?#18 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(smbd_smb2_request_process_query_directory+0x2e4) [0x7f3f25ab2634]
? ?#19 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(smbd_smb2_request_dispatch+0xcad) [0x7f3f25a9fe8d]
? ?#20 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(+0x12fab2) [0x7f3f25aa0ab2]
? ?#21 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(run_events_poll+0x16c) [0x7f3f23ddb95c]
? ?#22 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(+0x25bb0) [0x7f3f23ddbbb0]
? ?#23 /usr/lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x8d) [0x7f3f22a34d5d]
? ?#24 /usr/lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_wait+0x1b) [0x7f3f22a34efb]
? ?#25 /usr/lib/x86_64-linux-gnu/samba/libsmbd-base.so.0(smbd_process+0x6c9) [0x7f3f25a8f1f9]
? ?#26 smbd(+0x96b6) [0x7f3f265546b6]
? ?#27 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(run_events_poll+0x16c) [0x7f3f23ddb95c]
? ?#28 /usr/lib/x86_64-linux-gnu/libsmbconf.so.0(+0x25bb0) [0x7f3f23ddbbb0]
? ?#29 /usr/lib/x86_64-linux-gnu/libtevent.so.0(_tevent_loop_once+0x8d) [0x7f3f22a34d5d]
? ?#30 /usr/lib/x86_64-linux-gnu/libtevent.so.0(tevent_common_loop_wait+0x1b) [0x7f3f22a34efb]
? ?#31 smbd(main+0x15b4) [0x7f3f265526c4]
? ?#32 /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xf5) [0x7f3f2268cec5]
? ?#33 smbd(+0x7a96) [0x7f3f26552a96]
原来是talloc问题,又百度一通,发现可以通过下面的操作解决?
$ sudo apt-get remove samba libtalloc2$ sudo apt-get autoremove$ sudo apt-get install samba libtalloc2
重新配置samba服务,终于可以访问KylinShare目录了,整个世界清静了
?
45528754
《解决Samba服务无法访问 网络名不再可用的问题,生活中无法解决的问题》来自互联网同行内容,若有侵权,请联系我们删除!