【GNU/Linux, Debian】使用cups连接HP Laserjet 1012 HB打印机

woc我怎么第一版打的cpus

Cups是个开源的打印软件,于2007年被苹果收购(包括作者负责人也被苹果雇佣),收购后任然使用GPL发行。

然而2021年年底,作为收购前负责人的他表示这个软件再也不是美国苹果公司所维护的了,而是OpenPrinting接管后继的开发与维护。

使用cups而不用smb进行局域网分享的好处是iOS、macOS设备可以直接连接打印(Windows设备则是手动添加)


 

安装cups

apt upgrade
apt install printer-driver-all
apt install cups

#如果是iptables
iptables -I INPUT -p tcp --dport 631 -j ACCEPT


#如果是firewalld
firewall-cmd -- permanent --add-port=631/tcp
sudo service firewalld restart

修改配置文件

nano /etc/cups/cupsd.conf

配置文件里添加【Allow all】

# Only listen for connections from the local machine.
Listen 0.0.0.0:631
Listen /run/cups/cups.sock

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
Allow all
</Location>

<Location /admin>
  Order allow,deny
Allow all
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
Allow all
</Location>

ctrl+O,回车,然后ctrl+X,保存完成后重启cups

systemctl restart cups

 

cups网页端管理添加打印机并设置

然后在浏览器的【无痕模式】打开{IP地址}:631/admin,比如

http://10.192.56.122:631/admin

登入后就是这个界面,一步步添加打印机即可

 

 

 

使 用 有 ROOT 权 限 的 账 号 密 码 登 录,否则会提示

 

 

 因  为  我  找  了  好  久  都  没  找  到  账  号  登  出  按  钮 ! ! ! ! ! ! ! ! !

 

 

 

 

 

dlc1: 使用惠普的官方的HPLIP(我安装到后面卡住了)

#下载网址
https://developers.hp.com/hp-linux-imaging-and-printing/gethplip

wget https://sourceforge.net/projects/hplip/files/hplip/3.22.6/hplip-3.22.6.run
chmod 0755 ./hplip-3.22.6.run
./hplip-3.22.6.run

 

dlc2: Debian官方文档参考

参考:https://wiki.debian.org/SystemPrinting

posted on 2022-07-06 16:26  Cela  阅读(1081)  评论(0编辑  收藏  举报

导航

Copyright ©Cela
Design by Cela