为 Unix 组配置 samba 服务器

bea*_*rdc 3 active-directory redhat authentication samba

我正在尝试为 Linux (RHEL 6)“wheel”组中的用户设置一个具有访问权限的 samba 服务器。我将 smb.conf 建立在示例的基础上,这里通过[accounting]示例。在我的smb.conf我有

[tmp]
    comment = temporary files
    path = /var/share
    valid users = @wheel
    read only = No
    create mask = 0664
    directory mask = 02777
    max connections = 0
Run Code Online (Sandbox Code Playgroud)

(休息输出的$ testparm /etc/samba/smb.conf这里)。和

groups `whoami`
Run Code Online (Sandbox Code Playgroud)

返回user01 : wheel

当我作为 Linux 用户 ( user01)从另一台机器 (Mac OS) 使用以下命令时:

$ smbclient -L NETBIOSNAME/tmp
Run Code Online (Sandbox Code Playgroud)

它要求输入密码,我在没有密码的情况下按回车键,然后得到:

Enter user01's password:
Anonymous login successful
Domain=[DOMAIN] OS=[Unix] Server=[Samba 3.6.9-151.el6_4.1]
Sharename       Type      Comment
    ---------       ----      -------
    tmp             Disk      temporary files
    IPC$            IPC       IPC Service (Samba Server Version 3.6.9-151.el6_4.1)
Run Code Online (Sandbox Code Playgroud)

但是当我尝试

$ smbclient //NETBIOSNAME/tmp
Run Code Online (Sandbox Code Playgroud)

我尝试输入用于 Linux 登录的密码,并记录了大量内容,包括

check_sam_security: Couldn't find user 'user01' in passdb.
...
session setup failed: NT_STATUS_LOGON_FAILURE
Run Code Online (Sandbox Code Playgroud)

(如果有帮助,我可以提供更多日志信息。)

我找不到在资源中添加组用户所需的更多步骤的参考。我应该以某种方式从组中手动添加 samba 用户吗?

Fri*_*sen 5

这里的问题是 Samba 用户存储没有系统用户存在。在这种情况下,解决方案是

  1. 创建系统用户“user01”(已完成)
  2. 创建 samba 用户 smbpasswd -a user01
  3. 将“user01”添加到系统轮组

那么用户就可以访问共享了。为了避免维护两个用户数据库,您可以考虑使用 LDAP 之类的东西。