Solve the problem that Samba service can not access the network name is no longer available

Problem Description

Create a new virtual machine, install ubuntukylin-14.04.2-desktop-amd64 system

Configure the IP address as: 192.168.0.205

Then apt-get install samba, edit /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 add user, service smbd restart restart samba service

Open the resource manager on Windows 10, enter: \\ 192.168.0.205 in the address bar, you can see the KylinShare folder,

However, when double-clicking to access KylinShare, it prompts that there is no permission to access or the specified network name is no longer available .

 

Resolution process

First suspect it is a firewall issue, uninstall iptables, no

Baidu took a bit and said that it is the problem of SELinux. Make sure that the status of SELinux is disabled or not.

chmod 777 / opt / Share set directory permissions, still not work

Netstat -ntlp looked at the port number, both 139 and 445 were there, and it was determined that there was no problem with the communication

It is also said that there is a problem with the smb.conf configuration, but the same configuration is completely normal on Ubuntu14.04, hell

Baidu is coming to Baidu, and it is the above-mentioned reasons. The various attempts have been tossing for a long time, and it has never been possible.


Finally, by looking at the log file under / var / log / samba /, I found the following

[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_64sm-linux-gx 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-gnusm baseba. 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 / x86_l86 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_+man2_ent ]
   # 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) /
   # 7f8f8_88325 /3073 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 /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 / the 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]

It turned out to be the problem of talloc, and Baidu Yitong found that it can be solved by the following operation 

$ sudo apt-get remove samba libtalloc2
$ sudo apt-get autoremove
$ sudo apt-get install samba libtalloc2

After reconfiguring the samba service, you can finally access the KylinShare directory, and the whole world is quiet

 

Published 54 original articles · Like 89 · Visit 680,000+

Guess you like

Origin blog.csdn.net/ayang1986/article/details/102480595