不使用打印机,我想删除该cups-browsed
服务以提高系统安全性。我应该怎么做?
这个软件包叫做 cups-browsed,它与一些打印机功能兼容。我试过了sudo apt-get remove cups-browsed
,但并没有删除所有 cups-browsed 数据。
不使用打印机,我想删除该cups-browsed
服务以提高系统安全性。我应该怎么做?
这个软件包叫做 cups-browsed,它与一些打印机功能兼容。我试过了sudo apt-get remove cups-browsed
,但并没有删除所有 cups-browsed 数据。
我想告诉我的 cups 打印服务器保留所有打印作业,直到它们被手动释放。
使用cupsdisable --hold <printer or class>
会暂停打印机,并且lpoptions -p <printer> -o hold-job-until=indefinite
适用于本地提交的打印作业,但不适用于远程发送的作业。如何配置杯子以保留所有作业,直到手动释放它们为止?
在我的本地家庭网络中,我有 Debian 12 stable 和 CUPS 服务器的服务器。打印机 Epson L3100 连接到该服务器。
另外,我在本地网络中有 2 个客户端设备:Android 平板电脑和装有 Debian 12 的笔记本电脑。
如果我打开打印机(通过打印机上的按钮)并重新启动我的服务器sudo reboot
- 一切正常,我的客户端设备可以使用远程打印机打印任何页面。
但是,如果我打开打印机并且不重新启动服务器,客户端设备将无法检测到打印机。
半年前,当服务器上安装Debian 11 stable时,一切都很好,不需要每次都重新启动服务器,现在重新安装操作系统到Debian 12后,情况发生了变化。
在没有重新启动服务器的情况下,我在服务器上输入了几个命令:
> lsusb | grep L3100
Bus 001 Device 010: ID 04b8:1141 Seiko Epson Corp. L3100 Series
> lpstat -s
system default destination: L3100
device for L3100: usb://EPSON/L3100%20Series?serial=xxxxxxxxxxxxxxxxxx&interface=1
> lpstat -a
L3100 accepting requests since Tue 01 Aug 2023 17:14:32
> netstat -an | grep 631
tcp 0 0 0.0.0.0:631 0.0.0.0:* LISTEN
tcp6 0 0 :::631 :::* LISTEN
udp 0 0 0.0.0.0:631 0.0.0.0:*
使用命令重新启动 CUPS:sudo systemctl restart cups
没有帮助。
在我的/etc/cups/cupsd.conf
文件中:
Port 631
# Restrict access to the server...
<Location />
Order allow,deny
Allow 192.168.1.*
</Location>
# Restrict access to the admin pages...
<Location /admin>
Order allow,deny
Allow 192.168.1.*
</Location>
# Restrict access to configuration files...
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow 192.168.1.*
</Location>
无需重新启动所有服务器,我就可以进入 cups 界面并打印测试页 - 它可以工作。
需要做什么才能在本地网络上的客户端设备上进行打印而无需重新启动服务器?
更新:
当我在 Debian 客户端计算机上使用命令avahi-browse -art | less
(感谢)时,我看到输出:eyoung100
= wlp2s0 IPv4 Printer EPSON L3100 @ Beelink-U59 Internet Printer local
hostname = [Beelink-U59.local]
address = [192.168.1.15]
port = [631]
txt = ["printer-type=0x100E" "Color=T" "mopria-certified=1.3" "URF=V1.4,CP1,W8,PQ4,OFU0,SRGB24,RS300,FN3" "TLS=1.2" "UUID=a2d2f7b8-428a-3a50-5aef-81591a3b0180" "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "product=(EPSON L3100 Series)" "priority=0" "note=" "adminurl=https://Beelink-U59.local.:631/printers/L3100" "ty=EPSON L3100 Series , Epson Inkjet Printer Driver (ESC/P-R) for Linux" "rp=printers/L3100" "qtotal=1" "txtvers=1"]
= wlp2s0 IPv4 Printer EPSON L3100 @ Beelink-U59 UNIX Printer local
hostname = [Beelink-U59.local]
address = [192.168.1.15]
port = [0]
txt = []
= wlp2s0 IPv4 Printer EPSON L3100 @ Beelink-U59 Secure Internet Printer local
hostname = [Beelink-U59.local]
address = [192.168.1.15]
port = [631]
txt = ["printer-type=0x100E" "Color=T" "mopria-certified=1.3" "URF=V1.4,CP1,W8,PQ4,OFU0,SRGB24,RS300,FN3" "TLS=1.2" "UUID=a2d2f7b8-428a-3a50-5aef-81591a3b0180" "pdl=application/pdf,application/postscript,image/jpeg,image/png,image/pwg-raster,image/urf" "product=(EPSON L3100 Series)" "priority=0" "note=" "adminurl=https://Beelink-U59.local.:631/printers/L3100" "ty=EPSON L3100 Series , Epson Inkjet Printer Driver (ESC/P-R) for Linux" "rp=printers/L3100" "qtotal=1" "txtvers=1"]
UPD-2:
最终我解决了这个问题。我在 Docker 容器中安装了 CUPS ,并在客户端计算机上在实用程序 ( )olbat-cups
中配置了打印机,现在一切正常,无需重新启动服务器。system-config-printer
sudo apt install system-config-printer
用于配置打印机的 GNOME 3 GUI 很可能存在软件错误,导致打印机无法正常配置。
在服务器端,CUPS 安装的软件包版本之间很可能存在兼容性问题,从而导致错误stopped "Filter failed"
。
我有一台 Brother 激光打印机 DCP-1612W,当我打印一些带有图像的 PDF 时,即使没有打印任何内容,作业也会被标记为已完成(但打印机会发出一些噪音)。
我正在使用 brlaser 驱动程序。
在杯子日志中我找不到任何有用的东西。
journalctl --follow --unit=cups
Dec 06 21:24:31 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Adding start banner page "none".
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Queued on "Brother" by "dpd-".
Dec 06 21:24:31 PereBook cupsd[177160]: REQUEST localhost - - "POST /printers/Brother HTTP/1.1" 200 567 Create-Job successful-ok
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] File of type application/postscript queued by "dpd-".
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Adding end banner page "none".
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started filter /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/filter/gstopdf (PID 178823)
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started filter /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/filter/pdftopdf (PID 178824)
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started filter /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/filter/gstoraster (PID 178825)
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started filter /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/filter/rastertobrlaser (PID 178826)
Dec 06 21:24:31 PereBook cupsd[177160]: [Job 95] Started backend /nix/store/0ynxwkwr0vc021y1v0kljjdzp10vgd67-cups-progs/lib/cups/backend/ipp (PID 178827)
Dec 06 21:24:31 PereBook cupsd[177160]: REQUEST localhost - - "POST /printers/Brother HTTP/1.1" 200 3542310 Send-Document successful-ok
Dec 06 21:24:32 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:33 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:34 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:35 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:36 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:37 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:38 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:39 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:40 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:41 PereBook cupsd[177160]: Expiring subscriptions...
Dec 06 21:24:41 PereBook cupsd[177160]: Brother dpd- 95 [06/Dec/2023:21:24:41 +0100] total 1 1 localhost 2023.pdf A4 one-sided
Dec 06 21:24:41 PereBook cupsd[177160]: [Job 95] Job completed.
Dec 06 21:24:41 PereBook cupsd[177160]: Expiring subscriptions...
``
我需要通过从已安装打印机的 Debian 系统复制文件,在不运行任何 cups 命令的情况下手动安装打印机。
我必须通过这种方式进行,以便制作将安装打印机的 Debian live DVD。所以,如果我使用 Canon 安装程序,它会连接到主机的 cups 服务器,并将打印机安装在主机上,而不是安装在 chroot 中。
打印机是佳能 G3560,通过 USB 连接。设备 URI 是cnijbe2://Canon/?port=usb&serial=60A386
.
我已将驱动程序的 Debian 软件包复制cnijfilter2_6.10-1_amd64.deb
到config/packages.chroot/
live DVD 构建目录中。
我已经将文件复制/etc/cups/ppd/G3060USB.ppd
到/etc/cups/printers.conf
live DVD 构建目录:config/includes.chroot_after_packages/etc/cups/
.
当我运行 live 系统时,它显示打印机,但系统无法打印任何文档。
我有 2 个要取消的打印作业:
Tux # lpq
photosmart_7200 is not ready
Rank Owner Job File(s) Total Size
1st unknown 190 unknown 8192 bytes
2nd unknown 191 unknown 8192 bytes
由一些非 root localhost 用户(但是 lp 和 lpadmin 组的成员)创建,将任何 ascii 文本通过管道传输到lp
.)
然而 :
Tux # lprm -
lprm: Forbidden
Tux # cancel -a
cancel: cancel-job failed: Forbidden
不用说我通过 cups 的浏览器界面得到了相同的结果,/var/log/cups_error.log 说:
E [21/Sep/2022:08:41:10 +0200] [Client 9] Returning HTTP Interdit for Cancel-Job (ipp://localhost/jobs/190) from localhost
E [21/Sep/2022:08:47:00 +0200] [Client 14] Returning HTTP Interdit for Cancel-Job (ipp://localhost/jobs/191) from localhost
这些作业与它们的 d 文件和相关的控制文件一起位于 /var/spool/cups 中:
Tux /var/spool/cups # ls -ails
…
878712 4 -rw------- 1 root lp 1032 6 juin 15:18 c00190
878713 4 -rw------- 1 root lp 940 6 juin 15:18 c00191
878714 4 -rw------- 1 root lp 832 6 juin 15:18 c00192
891424 4 -rw------- 1 root lp 954 17 sept. 22:42 c00193
891442 4 -rw------- 1 root lp 954 17 sept. 22:42 c00194
891435 4 -rw------- 1 root lp 954 17 sept. 22:42 c00195
878708 8 -rw-r----- 1 root lp 7288 6 juin 15:17 d00190-001
878711 8 -rw-r----- 1 root lp 7288 6 juin 15:18 d00191-001
885657 4 drwxrwx--T 2 root lp 4096 29 août 08:32 tmp
在 linux-5.4 下运行 cups-2.4.2(最有可能创建运行 cups-2.3.3 的作业)
那么为什么这些命令实际上不能取消作业,我怎样才能礼貌地(避免在 spool 目录中对它们进行 rm-ing)取消这些作业。此外,由于控制文件显示有效的用户名
,是否可以解释这些作业的所有者如何被报告为“未知” ?lpq
我想用 Debian Stretch 替换旧服务器,现在已经用 Debian Bullseye 安装了一个。
使用 Debian 11,我现在错过了在 Cups 中插入打印机 Windows SMB 的可能性。使用“lpinfo -v”,旧系统仍然显示“network smb”。有了新的,它就不见了。
我忘记安装软件包了吗?
apt list --installed | grep samba
WARNING: apt does not have a stable CLI interface. Use with caution in scripts.
python3-samba/stable-security,now 2:4.13.13+dfsg-1~deb11u3 amd64 [Installiert,automatisch]
samba-common-bin/stable-security,now 2:4.13.13+dfsg-1~deb11u3 amd64 [Installiert,automatisch]
samba-common/stable-security,now 2:4.13.13+dfsg-1~deb11u3 all [Installiert,automatisch]
samba-dsdb-modules/stable-security,now 2:4.13.13+dfsg-1~deb11u3 amd64 [Installiert,automatisch]
samba-libs/stable-security,now 2:4.13.13+dfsg-1~deb11u3 amd64 [Installiert,automatisch]
samba-vfs-modules/stable-security,now 2:4.13.13+dfsg-1~deb11u3 amd64 [Installiert,automatisch]
samba/stable-security,now 2:4.13.13+dfsg-1~deb11u3 amd64 [installiert]
过去,我能够使用自制过滤器来支持具有特定打印机名称的旧系统。
lpadmin -p PCL2PRINTER -i /root/pcltoprinter.sh -v cups-pdf:/ -E
我经常使用这个,我的脚本真的很有帮助,但现在我不再能够使用这样的过滤器,因为它看起来像 lpadmin 不再支持过滤器了。我收到错误lpadmin: Unable to open PPD "/root/pcl2printer.sh": Missing asterisk in column 1 on line 1.
lpadmin only accept ppd file but no more scripts ?
如果我手动将脚本放入/etc/cups/interfaces/PCL2PRINTER
其中,则不会考虑在内。
您是否知道如何设置我的脚本,以便任何打印到特定打印机的内容都将通过我的脚本。
编辑:解决方案-> 卸载突然阻止我的脚本运行的 apparmor。(太糟糕了)
我最近在更新时收到以下消息。这
N: Skipping acquire of configured file...
是关于我的。我环顾四周,看看是否有解决方案,但找不到任何东西。
这hl2270dw
是我成功使用的兄弟打印机。任何摆脱这种情况的信息表示赞赏。
[doy@sandbar ~]$ sudo apt update
[sudo] password for doy:
Hit:1 https://download.virtualbox.org/virtualbox/debian stretch InRelease
Hit:2 https://repo.windscribe.com/debian stretch InRelease
Ign:3 http://ftp.us.debian.org/debian stretch InRelease
Hit:4 http://ftp.us.debian.org/debian stretch-updates InRelease
Hit:5 http://ftp.us.debian.org/debian stretch Release
Hit:7 http://security.debian.org/debian-security stretch/updates InRelease
Reading package lists... Done
Building dependency tree
Reading state information... Done
All packages are up to date.
N: Skipping acquire of configured file 'main/binary-cupswrapperhl2270dw/Packages' as repository 'https://repo.windscribe.com/debian stretch InRelease' doesn't support architecture 'cupswrapperhl2270dw'
N: Skipping acquire of configured file 'main/binary-cupswrapperhl2270dw/Packages' as repository 'http://ftp.us.debian.org/debian stretch-updates InRelease' doesn't support architecture 'cupswrapperhl2270dw'
N: Skipping acquire of configured file 'contrib/binary-cupswrapperhl2270dw/Packages' as repository 'http://ftp.us.debian.org/debian stretch-updates InRelease' doesn't support architecture 'cupswrapperhl2270dw'
N: Skipping acquire of configured file 'main/binary-cupswrapperhl2270dw/Packages' as repository 'http://ftp.us.debian.org/debian stretch InRelease' doesn't support architecture 'cupswrapperhl2270dw'
N: Skipping acquire of configured file 'contrib/binary-cupswrapperhl2270dw/Packages' as repository 'http://ftp.us.debian.org/debian stretch InRelease' doesn't support architecture 'cupswrapperhl2270dw'
N: Skipping acquire of configured file 'main/binary-cupswrapperhl2270dw/Packages' as repository 'http://security.debian.org/debian-security stretch/updates InRelease' doesn't support architecture 'cupswrapperhl2270dw'
N: Skipping acquire of configured file 'contrib/binary-cupswrapperhl2270dw/Packages' as repository 'http://security.debian.org/debian-security stretch/updates InRelease' doesn't support architecture 'cupswrapperhl2270dw'
编辑(20200220):
[doy@sandbar ~]$ sudo dpkg --print-foreign-architectures
cupswrapperhl2270dw
[doy@sandbar ~]$ cat /etc/apt/sources.list
#
# deb cdrom:[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 NETINST 20180714-10:25]/ stretch main
# deb cdrom:[Debian GNU/Linux 9.5.0 _Stretch_ - Official amd64 NETINST 20180714-10:25]/ stretch main
deb http://ftp.us.debian.org/debian/ stretch main contrib
deb-src http://ftp.us.debian.org/debian/ stretch main contrib
deb http://security.debian.org/debian-security stretch/updates main contrib
deb-src http://security.debian.org/debian-security stretch/updates main contrib
# stretch-updates, previously known as 'volatile'
deb http://ftp.us.debian.org/debian/ stretch-updates main contrib
deb-src http://ftp.us.debian.org/debian/ stretch-updates main contrib
[doy@sandbar ~]$ cat /etc/apt/sources.list.d/*
# deb http://download.virtualbox.org/virtualbox/debian stretch contrib
deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian stretch contrib
#deb http://download.virtualbox.org/virtualbox/debian stretch contrib
deb [arch=amd64] https://download.virtualbox.org/virtualbox/debian stretch contrib
deb https://repo.windscribe.com/debian stretch main
deb https://repo.windscribe.com/debian stretch main