为 CUPS 打印机(又名 Point'n'Print)设置 Windows 驱动程序

为 CUPS 打印机(又名 Point'n'Print)设置 Windows 驱动程序

我在 Debian 8 上运行 Samba 4.2.10 和 CUPS 1.7.5。服务器是域成员。在 CUPS 中我有几台打印机,我将它们与 Samba 共享。从 CUPS 打印测试页工作正常,通过 IPP 从 Windows 客户端打印,Samba 工作正常。我想设置 Point'n'Print - 在 print$ share 中共享 Windows 驱动程序,以便 Windows 客户端在连接到打印机时可以自动获取它们。

我已将 CUPS 和 Windows PS 驱动程序存储为/usr/share/samba/drivers我找到的每个教程中所述的方式,并尝试通过以下方式导出它们:

cupsaddsmb -U root -a -v

该命令在共享内创建文件夹 W32X86 和 x64 print$,复制驱动程序文件,然后尝试使用命令将驱动程序与打印机关联:

rpcclient localhost -N -A /tmp/0141f574d8313 -c 'setdriver PV PV'

最后出现了这个错误:

resolve_lmhosts: Attempting lmhosts lookup for name localhost<0x20> resolve_lmhosts: Attempting lmhosts lookup for name localhost<0x20> resolve_wins: WINS server resolution selected and no WINS servers listed. resolve_hosts: Attempting host lookup for name localhost<0x20> Connecting to ::1 at port 445 Doing spnego session setup (blob length=96) got OID=1.2.840.48018.1.2.2 got OID=1.2.840.113554.1.2.2 got OID=1.3.6.1.4.1.311.2.2.10 got principal=not_defined_in_RFC4178@please_ignore GENSEC backend 'gssapi_spnego' registered GENSEC backend 'gssapi_krb5' registered GENSEC backend 'gssapi_krb5_sasl' registered GENSEC backend 'spnego' registered GENSEC backend 'schannel' registered GENSEC backend 'naclrpc_as_system' registered GENSEC backend 'sasl-EXTERNAL' registered GENSEC backend 'ntlmssp' registered GENSEC backend 'ntlmssp_resume_ccache' registered GENSEC backend 'http_basic' registered GENSEC backend 'http_ntlm' registered GENSEC backend 'krb5' registered GENSEC backend 'fake_gssapi_krb5' registered Got challenge flags: Got NTLMSSP neg_flags=0x62898215 NTLMSSP: Set final flags: Got NTLMSSP neg_flags=0x62088215 NTLMSSP Sign/Seal - Initialising with flags: Got NTLMSSP neg_flags=0x62088215 NTLMSSP Sign/Seal - Initialising with flags: Got NTLMSSP neg_flags=0x62088215 SetPrinter call failed! result was WERR_ACCESS_DENIED

如上所述这里,执行此命令的用户应具有 SePrintOperatorPrivilege。由于我以 root 身份运行此命令,因此我将用户添加到 samba:

smbpasswd -a root

并添加所需的权限:

net rpc rights grant root SePrintOperatorPrivilege

我检查了设置:

# net rpc rights list root SeMachineAccountPrivilege SeRemoteShutdownPrivilege SePrintOperatorPrivilege SeAddUsersPrivilege SeDiskOperatorPrivilege

一切似乎都很好。因此,让我们再次手动关联驱动程序和打印机:

# rpcclient localhost -c 'setdriver PV PV' Registered MSG_REQ_POOL_USAGE Registered MSG_REQ_DMALLOC_MARK and LOG_CHANGED Enter root's password: Connecting to ::1 at port 445 Doing spnego session setup (blob length=96) got OID=1.2.840.48018.1.2.2 got OID=1.2.840.113554.1.2.2 got OID=1.3.6.1.4.1.311.2.2.10 got principal=not_defined_in_RFC4178@please_ignore GENSEC backend 'gssapi_spnego' registered GENSEC backend 'gssapi_krb5' registered GENSEC backend 'gssapi_krb5_sasl' registered GENSEC backend 'spnego' registered GENSEC backend 'schannel' registered GENSEC backend 'naclrpc_as_system' registered GENSEC backend 'sasl-EXTERNAL' registered GENSEC backend 'ntlmssp' registered GENSEC backend 'ntlmssp_resume_ccache' registered GENSEC backend 'http_basic' registered GENSEC backend 'http_ntlm' registered GENSEC backend 'krb5' registered GENSEC backend 'fake_gssapi_krb5' registered Got challenge flags: Got NTLMSSP neg_flags=0x62898215 NTLMSSP: Set final flags: Got NTLMSSP neg_flags=0x62088215 NTLMSSP Sign/Seal - Initialising with flags: Got NTLMSSP neg_flags=0x62088215 NTLMSSP Sign/Seal - Initialising with flags: Got NTLMSSP neg_flags=0x62088215 SetPrinter call failed! result was WERR_ACCESS_DENIED

同样的问题,我束手无策。我可以看到print$共享中的驱动程序文件,也可以看到printmanagement.mscWindows 客户端上的控制台。在那个管理控制台中,我也无法进行关联。保存对话框时,我收到“无法保存打印机设置。拒绝访问。”。可能与上面的问题相同。但在这种情况下,我以没有 SePrintOperatorPrivilege 的域用户身份访问它,所以这里没有责备:)

答案1

像往常一样,经过几天的苦思冥想后,我发布了这个问题,然后最后一次尝试在谷歌上寻找解决方案。我找到了。

我的问题出在 中的参数use client drivers = yes/etc/samba/smb.conf。需要将其设置为no或根本不设置。我根据之前找到的一些教程添加了它并将其保留在那里。

无论如何,这里是 Point'n'Print 的出色调试指南:https://lists.samba.org/archive/samba/2013-November/176711.html

这是解决我的问题的消息:https://lists.samba.org/archive/samba/2013-November/176714.html

附注:谷歌搜索werr_access_denied site:samba.org有帮助......

相关内容