Samba 无法共享文件夹 - 无法将名称“Everyone”转换为 SID

Samba 无法共享文件夹 - 无法将名称“Everyone”转换为 SID

几天前 samba 共享成功后,今天我又遇到了同样的情况,但却收到以下错误:

'net usershare' returned error 255: net usershare add: cannot convert name "Everyone" to a SID. 
The connection was refused. Maybe smbd is not running.

当我尝试启动/重新启动 samba 服务时,出现以下信息

$ sudo service samba status
 * nmbd is running
 * smbd is not running
$ sudo service samba start
$ sudo service samba restart
$ sudo service samba status
 * nmbd is running
 * smbd is not running

我的/var/log/samba/smbd.log

[2014/01/15 16:21:46,  0] smbd/server.c:1072(main)
  smbd version 3.6.18 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2011
[2014/01/15 16:21:46.426302,  0] smbd/server.c:1128(main)
  standard input is not a socket, assuming -D option
[2014/01/15 16:21:46.428538,  0] auth/auth_util.c:708(get_guest_info3)
  SamInfo3_for_guest: Unable to locate guest account [guest]!
[2014/01/15 16:21:46.428578,  0] smbd/server.c:1251(main)
  ERROR: failed to setup guest info.

我的/etc/samba/smb.conf

$ grep -E "^[^#;].*" /etc/samba/smb.conf
[global]
   workgroup = WORKGROUP
   server string = %h server (Samba, Ubuntu)
   dns proxy = no
   log file = /var/log/samba/log.%m
   max log size = 1000
   syslog = 0
   panic action = /usr/share/samba/panic-action %d
   encrypt passwords = true
   passdb backend = tdbsam
   obey pam restrictions = yes
   unix password sync = yes
   passwd program = /usr/bin/passwd %u
   passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
   pam password change = yes
   map to guest = bad user
        usershare allow guests = yes
        username map = /etc/samba/smbusers
        security = user
        guest ok = yes
        ; guest account = nobody
  usershare max shares = 100
  usershare owner only = False

答案1

问题出在用户名上。我取消了此行的注释:

guest account = nobody

我的系统中有nobody用户,现在它运行良好。

答案2

此错误也出现在正常用户会话中。我在 2 台全新安装 Ubuntu 14.04 的机器上都遇到了此问题。

我已经提交了错误报告 https://bugs.launchpad.net/ubuntu/+source/samba/+bug/1299186

如果您遇到同样的问题,请将该错误标记为“也影响我”,因为当此错误发生时,apport 不会自动触发。

答案3

为了使 usershare 正常工作,smbd 还必须绑定到本地主机,即

接口 = 192.168.0.100/8 eno1 127.0.0.1/8 lo

相关内容