0

我在 Debian Wheezy 上使用 Samba 3.6.6。

我希望能够使用我的 macbook 更改我的开发服务器上的 www 文件。所以我设置了 samba 并为 /var/www 目录做了一个共享。

我将用户 bart 和 root 添加到 samba 以进行连接。并使用命令 K 连接,然后使用 smb://192.168.2.100 (我的 samba 服务器)。

由于 apache 使用 www-data 作为 www 文件的用户和组,我在 samba 中使用强制用户和强制组来防止权限错误。

但是它确实强制组 www-data,但不强制用户。我创建的每个文件都归组 www-data 中的 root 所有。

为了寻找错误,我跟踪了 /var/log/samba 中的日志,并且仅在重新启动 samba 服务时在 log.smbd 中发现了错误。在此处查看日志:

smbd version 3.6.6 started.
  Copyright Andrew Tridgell and the Samba Team 1992-2011
[2013/09/23 11:14:22.601031,  0] printing/print_cups.c:110(cups_connect)
  Unable to connect to CUPS server localhost:631 - Connection refused
[2013/09/23 11:14:22.602215,  0] printing/print_cups.c:487(cups_async_callback)
  failed to retrieve printer list: NT_STATUS_UNSUCCESSFUL

这是我的 smb.conf:

[global]
    server string = %h server
    map to guest = Bad User
    obey pam restrictions = Yes
    pam password change = Yes
    passwd program = /usr/bin/passwd %u
    passwd chat = *Enter\snew\s*\spassword:* %n\n *Retype\snew\s*\spassword:* %n\n *password\supdated\ssuccessfully* .
    unix password sync = Yes
    syslog = 0
    log file = /var/log/samba/log.%m
    max log size = 1000
    dns proxy = No
    usershare allow guests = Yes
    panic action = /usr/share/samba/panic-action %d
    idmap config * : backend = tdb

[homes]
    comment = Home Directories
    valid users = %S
    create mask = 0700
    directory mask = 0700
    browseable = No

[printers]
    comment = All Printers
    path = /var/spool/samba
    create mask = 0700
    printable = Yes
    print ok = Yes
    browseable = No

[print$]
    comment = Printer Drivers
    path = /var/lib/samba/printers

[www]
    comment = www
    path = /var/www/
    valid users = bart, root
    admin users = bart, root
    write list = bart, root
    force user = www-data
    force group = www-data
    read only = No

我什至尝试将 www-data 添加到有效用户以及管理员用户和写入列表中。这当然没有任何效果。

你能帮我吗?提前致谢!

4

1 回答 1

1

在其他人的帮助下,他说:

“我认为在这种情况下,选项管理员用户会覆盖选项强制用户。”

我删除了管理员用户,我的问题解决了!

于 2013-09-23T10:38:53.837 回答