![如何修复与 SAMBA 打印共享(Ubuntu 19.10)的连接失败?](https://linux22.com/image/1067664/%E5%A6%82%E4%BD%95%E4%BF%AE%E5%A4%8D%E4%B8%8E%20SAMBA%20%E6%89%93%E5%8D%B0%E5%85%B1%E4%BA%AB%EF%BC%88Ubuntu%2019.10%EF%BC%89%E7%9A%84%E8%BF%9E%E6%8E%A5%E5%A4%B1%E8%B4%A5%EF%BC%9F.png)
我最近安装了 Ubuntu 19.10,并想连接到本地网络上的打印服务,该服务通过 SAMBA 为 Linux 用户共享。虽然这在 18.04/18.10 上完美运行,但对我来说却无法正常工作。在 上journalctl -r
,按下核实按钮打印机属性对话:
gnome-control-center.desktop: Kinit for user@DOMAIN to access SERVER failed: Cannot contact any KDC for requested realm
gnome-control-center.desktop: Caught non-fatal exception. Traceback:
gnome-control-center.desktop: File "/usr/share/system-config-printer/newprinter.py", line 2861, in on_btnSMBVerify_clicked
gnome-control-center.desktop: os.O_RDWR, 0o777)
gnome-control-center.desktop: smbc.PermissionError: (13, 'Permission denied')
gnome-control-center.desktop: Continuing anyway..
此外,我在打印测试页时反复收到要求 SAMBA 凭据的通知(队列将作业列为“等待身份验证”)。后者可能是因为只要验证失败,我的凭据似乎就不会保存在打印机属性中。
虽然那个问题似乎有点老了,我试过了这一最新建议来自 Debian 错误邮件列表,建议通过修改相应的 Python 脚本来关闭 Kerberos。请阅读那里的详细说明。但是,执行此操作后,我收到另一个错误:
gnome-control-center.desktop: Caught non-fatal exception. Traceback:
gnome-control-center.desktop: File "/usr/share/system-config-printer/newprinter.py", line 2861, in on_btnSMBVerify_clicked
gnome-control-center.desktop: os.O_RDWR, 0o777)
gnome-control-center.desktop: smbc.NoEntryError: (2, 'No such file or directory')
gnome-control-center.desktop: Continuing anyway..
希望得到一些帮助。
答案1
sudo service cups stop
- 在文件中
/etc/cups/printers.conf
,使用 sudo 将行更改AuthInfoRequired none
为AuthInfoRequired username,password
打印机块中的行,在我的情况下是<DefaultPrinter ...>
sudo service cups start
- 然后,打印应该要求您输入凭据,在我的情况下,遵循模式
DOMAIN\username
并像往常一样输入密码,以及“记住”复选框。
注1:要查看复选框,我不得不使用最近的 Gnome 应用程序(如 Eye of Gnome,eog
)的“打印...”选项。它没有出现在作业队列的密码对话框中。
笔记2:我没有被要求输入密码旧的工作队列对话可通过“其他打印机设置...”访问。但是,在新作业队列打印机直接列在Gnome 设置->设备->打印机,可以点击“作业”并应该看到排队项目上方的身份验证请求。
目前,似乎有两代 GUI 以一种令人遗憾的方式混合在一起。
答案2
我相信你遇到了 bug#1849859
答案3
我在 Ubuntu 22.04 中设置打印机时遇到了类似的错误。
úno 05 10:56:47 luks-14ITL5 gnome-wifi-panel.desktop[446101]: Continuing anyway..
úno 05 10:56:47 luks-14ITL5 gnome-wifi-panel.desktop[446101]: smbc.NoEntryError: [Errno 2] No such file or directory
úno 05 10:56:47 luks-14ITL5 gnome-wifi-panel.desktop[446101]: f = ctx.open ("smb://%s/%s" % (host, share),
úno 05 10:56:47 luks-14ITL5 gnome-wifi-panel.desktop[446101]: File "/usr/share/system-config-printer/newprinter.py", line 2879, in on_btnSMBVerify_clicked
úno 05 10:56:47 luks-14ITL5 gnome-wifi-panel.desktop[446101]: raise exc
úno 05 10:56:47 luks-14ITL5 gnome-wifi-panel.desktop[446101]: File "/usr/share/system-config-printer/pysmb.py", line 180, in failed
úno 05 10:56:47 luks-14ITL5 gnome-wifi-panel.desktop[446101]: smbc_auth.failed (e)
úno 05 10:56:47 luks-14ITL5 gnome-wifi-panel.desktop[446101]: File "/usr/share/system-config-printer/newprinter.py", line 2883, in on_btnSMBVerify_clicked
úno 05 10:56:47 luks-14ITL5 gnome-wifi-panel.desktop[446101]: Caught non-fatal exception. Traceback:
úno 05 10:56:10 luks-14ITL5 gnome-wifi-panel.desktop[446101]: Continuing anyway..
úno 05 10:56:10 luks-14ITL5 gnome-wifi-panel.desktop[446101]: smbc.NoEntryError: [Errno 2] No such file or directory
úno 05 10:56:10 luks-14ITL5 gnome-wifi-panel.desktop[446101]: f = ctx.open ("smb://%s/%s" % (host, share),
úno 05 10:56:10 luks-14ITL5 gnome-wifi-panel.desktop[446101]: File "/usr/share/system-config-printer/newprinter.py", line 2879, in on_btnSMBVerify_clicked
úno 05 10:56:10 luks-14ITL5 gnome-wifi-panel.desktop[446101]: raise exc
úno 05 10:56:10 luks-14ITL5 gnome-wifi-panel.desktop[446101]: File "/usr/share/system-config-printer/pysmb.py", line 180, in failed
úno 05 10:56:10 luks-14ITL5 gnome-wifi-panel.desktop[446101]: smbc_auth.failed (e)
úno 05 10:56:10 luks-14ITL5 gnome-wifi-panel.desktop[446101]: File "/usr/share/system-config-printer/newprinter.py", line 2883, in on_btnSMBVerify_clicked
úno 05 10:56:10 luks-14ITL5 gnome-wifi-panel.desktop[446101]: Caught non-fatal exception. Traceback:
我必须安装sudo apt-get install python3-smbc smbclient
。设置打印机时,我总是单击“验证”,但这总是导致此错误。但是,当我保存凭证信息并且没有验证连接时,打印机开始运行。因此,您可以尝试跳过验证步骤并直接保存打印机。