目前的Linux发行版本基本上都使用cups作为Linux下管理打印的服务应用。CUPS软件为Unix/Linux用户提供了有效而可靠的方式来管理打印的方法。 服务,可以通过下面的命令获得版本: # rpm -qa|grep cups cups-libs-1.1.22-0.rc1.9.6.3AX gimp-print-cups-4.2.7-2.1AX libgnomecups ,cups是只允许本地打印,我们要修改它。 修改/etc/cups/cups.conf文件,把: 引用 Order Deny,Allow Deny From All Allow From 127.0.0.1 改为: 引用 Order Deny 2、Linux客户端 这里我使用的是红旗桌面 5.0,其实就是在Xwin下本地的cups服务连接到远程的cups服务器上,方法是非常简单的。
这里为大家介绍一下如何使用自己家里的linux机器搭建cups打印服务器,实现多台电脑共享打印机并且使用蒲公英远程打印 下面的演示使用debian系统的服务器为例,如果家里没有服务器可以使用本地电脑搭建虚拟机体验 ,搭建虚拟机教程可在搜索引擎中查找https://www.baidu.com准备好服务器后,首先进入终端输入下面命令,安装cups服务 sudo apt-get install cups 等待安装成功之后编辑 /etc/cups/cupsd.conf文件,如图将监听地址改成0.0.0.0,并且在Order allow,deny下添加Allow all 然后重启一下cups的服务 /etc/init.d/cups
一、CVE-2024-47177,CUPS打印机任务RCE漏洞 !quote(https://discussions.apple.com/thread/255781685? sortBy=rank) (一)漏洞条件 CVE-2024-47176 - cups-browsed <= 2.0.1 binds on UDP INADDR_ANY:631 trusting any the IPP attributes returned from an IPP server, providing attacker-controlled data to the rest of the CUPS 服务的命令注入漏洞,触发流程可分为 3 个关键步骤: 参数可控:cups-browsed 服务在处理网络打印机的 IPP 响应时,会提取响应中的FoomaticRIP参数(用于指定打印机的渲染工具路径 触发执行:当目标设备的 cups-browsed 服务尝试使用该恶意FoomaticRIP参数初始化打印机时,会直接通过系统 Shell 执行参数中的恶意命令,最终导致远程代码执行(RCE) 。
lpstat命令用于显示CUPS中打印机的状态信息。
仅限会员阅读的故事:Linux CUPS中的多个漏洞 (CVSS 9.9)多个CUPS漏洞 — Linux CUPS中的远程代码执行 (CVE-2024–47076 / CVE-2024–47175 / CVE-2024–47176 / CVE-2024–47177)描述:通用UNIX打印系统 (CUPS) 中几个新披露的漏洞对Linux系统构成了严重威胁。 这些缺陷允许远程攻击者利用CUPS中的弱点,可能在不需用户交互的情况下导致未经授权的代码执行。这些漏洞影响默认配置,如果未打补丁,将使数百万系统处于风险之中。 Odin Dork搜索语法: services.modules.http.headers.server: “CUPS”按回车键或单击以查看完整大小的图片Shodan搜索语法: server: cups product:”CUPS (IPP)”按回车键或单击以查看完整大小的图片参考链接: https://github.com/RickdeJager/cupshax受影响CVE简介:CVE-2024–47076
我们需要安装下列软件: System-Config-Printer Common Unix Printing System - CUPS hplip.x86_64 : HP Linux Imaging printcap name = cups load printers = yes cups options = raw [homes] 服务: ~ sudo systemctl start cups 可以使用 systemctl status cups 命令来进行查看服务状态。 man cups : NAME cups - a standards-based, open source printing system DESCRIPTION CUPS 添加打印机: 安装 cups 后,可以使用 cups web 服务( http://localhost:631/jobs/ )来添加 打印机。
CUPS scheduler. <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default cups start 6.接着浏览器访问http://你的树莓派IP地址:631进入cups的配置界面,可以看到cups还是挺注重用户使用的,制作了网页来方便用户配置吧。
CUPS打印服务 CUPS(Common Unix Printing System)是苹果公司开发的用于macOS和类Unix系统上的开源打印系统。 Github地址:CUPS CUPS功能强大,支持多种打印协议,包括Socket、LPD、IPP等。 以下为macOS上添加的的CUPS打印机列表: 在macOS上安装CUPS之后可以使用CUPS自带的lp/lpr命令创建打印任务,也可以使用其他命令进行打印机和任务管理。 CUPS依赖PPD(PostScript Printer Description)文件来描述打印机,PPD文件描述了打印机的型号、厂商、所需的cups filter驱动程序以及支持的尺寸等信息。 cups并在Android上运行起来(由于Android上没有实际使用的canon打印机的cups驱动,因此调试成功手头的打印机): 另外Github上也有人通过busybox将CUPS
Debian8上通过apt-get install cups来安装CUPS, CUPS实际上是一个集成的服务。包括了前端接收打印命令的程序,后端控制打印机的程序,中间则是打印驱动。 首当CUPS接受到打印命令时,首先会进行一个格式的预转换,比如将.txt等各种文件先转换成PostScript格式,然后进一步将PostScript格式转换成 CUPS内部格式,这里我们不再深究。 下面详细说CUPS的配置过程。 在/etc/cups/printers.conf文件中添加我们自己的打印机FAX,内容如下: ? 我们主要说DeviceURI,DeviceURI 用来指出/usr/lib/cups/backend下的下一步处理程序,这里指向下面的/usr/lib/cups/backend/脚本的testfax脚本 当然配置有变动我们需要执行systemctl restart cups来重启CUPS,然后在同一个局域网内添加我们刚创建好的网络打印机,以win7为例: 选【控制面板】-> 【打印机和传真】->【添加打印机
-y cups 2、启动并设置cupssystemctl start cups 确保防火墙已经放通631端口,楼主一开始就在这里卡了很久,怎么也访问不了设置页面firewall-cmd –permanent –add-port=631/tcp service firewalld restart 这时候是无法从局域网内访问cups的,原因是因为cups的配置只允许本地访问。 这时候需要编辑cups的配置文件vi /etc/cups/cupsd.conf 将Listen 改为Port 631 在如图位置添加Allow All 然后重启cupsservice cups restart 本人的两台打印机都不在cups的支持范围之内,没有相关的驱动,只能采用上述方式进行共享打印(使用的是windows上安装的驱动),手机打印的话因没有cups上的驱动,打印出来的都是空白。 上unraid的app中搜了下,好像没有cups的应用。网上搜了很多资料,都没有介绍利用unraid上的docker安装cups的,大多都是群晖的docker内安装,看了unraid的还是小众一些。
CUPS CUPS is the standards-based, open source printing system developed by Apple Inc. for macOS® and 接着需要确保cups允许所有的流量请求,然后重启cups ? 重启失败 ? ? https://树莓派IP:631(注意分号),虽然是s的加密http但是,还是骗人! 复制到浏览器打开,其实在局域网内任意一个浏览器都可以~ 如果没有你的打印机驱动也不要紧,上网搜搜PPD文件来告诉CUPS如何配置你的打印机即可。 sudo apt-get install hplip 安装hplip的时候应该已经同步安装好Cups了,如果没有,可以执行下列命令继续安装。 下面替换CUPS的配置文件,首先停止服务 sudo service cups stop 备份原有文件 sudo mv /etc/cups/cupsd.conf /etc/cups/cupsd.conf.bak
这个方法需要:一台不关机的linux设备(路由器, 主机都行)设备有线直连打印机(或拥有稳定的打印机访问)设备连接局域网并具有稳定ip地址效果展示图片过程Ubuntu安装CUPS服务本文以 Ubuntu 22.04 为例, 已使用 HP smart 安装打印机驱动并有线连接打印机. # 安装apt install cups aptitudeaptitude install ghostscriptaptitude install foomatic# 启用sudo systemctl start cupssudo systemctl enable cups# sudo nano /etc/cups/cupsd.conf :631 --> Listen 0.0.0.0:631Order allow,deny --> 在下面一行增加Allow all更改后重启服务:sudo systemctl restart cups其后进入 引用如何使用Ubuntu服务器、CUPS和Bonjour配置打印服务器-A5互联ubuntu系统搭建cups打印机服务器 – 折腾 – 在网络的世界中一起折腾
httpd.service 实例 #停止cup电源管理服务 > systemctl stop cups.service #禁止cups服务开机启动 > systemctl disable cups.service #查看cups服务状态 > systemctl status cups.service #重新设置cups 服务开机启动 > systemctl enable cups.service 常用的系统命令 systemctl命令 说明
安装 默认情况下cups不提供该驱动,需要自己下载 https://dl.konicaminolta.eu/en/? /install.pl 之后一路回车,主要是把ppd文件拷贝到cups的目录下 然后重启cups服务 systemctl restart cups 或者 /etc/init.d/cups restart 配置cups cups会自动查询可用的打印机,这里可能出现两个,我是通过网络链接这个打印机,所以使用有MAC地址的那个。
httpd.service 实例 #停止cup电源管理服务 > systemctl stop cups.service #禁止cups服务开机启动 > systemctl disable cups.service #查看cups服务状态 > systemctl status cups.service #重新设置cups 服务开机启动 > systemctl enable cups.service 常用的系统命令 systemctl命令 说明
httpd.service 重载服务 service httpd reload systemctl reload httpd.service 实例 #停止cup电源管理服务 > systemctl stop cups.service #禁止cups服务开机启动 > systemctl disable cups.service #查看cups服务状态 > systemctl status cups.service #重新设置cups 服务开机启动 > systemctl enable cups.service 常用的系统命令 systemctl命令 说明 systemctl 列出所有的系统服务 systemctl list-units
设置服务开机启动 chkconfig [服务] off systemctl disable [unit type] 设备服务禁止开机启动 示例: #停止cup电源管理服务 systemctl stop cups.service #禁止cups服务开机启动 systemctl disable cups.service #查看cups服务状态 systemctl status cups.service #重新设置cups 服务开机启动 systemctl enable cups.service 参考资料 linux命令学习之:systemctl Asp.NetCore轻松学-部署到 Linux 进行托管
#禁止cups服务开机启动 systemctl disable cups.service #查看cups服务状态 systemctl status cups.service #重新设置cups服务开机启动 systemctl enable cups.service 2.2、查看系统上上所有的服务 命令格式: systemctl [command] [–type=TYPE] [–all] 参数详解: command 查看网络服务是否启动 systemctl is-active network.service #检查网络服务是否设置为开机启动 systemctl is-enabled network.service #停止cups 服务 systemctl stop cups.service #注销cups服务 systemctl mask cups.service #查看cups服务状态 systemctl status cups.service #取消注销cups服务 systemctl unmask cups.service 4、init 命令与systemctl命令对比 init命令 systemctl命令 说明 init 0 systemctl
+ marker+ ")"); } void f( int marker){ print("f(" + marker + ")"); } } class Cups static{ cup1 = new Cup(1); cup2 = new Cup(2); } Cups (){ print("Cups()"); } } public class ExplicitStatic { public static void Cups. cup1.f(99); Cups c=new Cups(); } } /* Cup(1) Cup(2) f(99) Inside main() f (99) Cups() */ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ package javat;
If he is late for 5 minutes, he owes two cups of tea. If he is late for 15 minutes, he owes three cups of tea. And if he is late for 30 minutes or more, he owes 4 cups of tea. Your task is to find how many cups of tea Andrew owes. Output Write to the output file the number of cups Andrew owes.