- 更新apt
apt-update
- 安装相关软件
apt-get install ghostscript
apt-get install dc
apt-get install foomatic-db-engine
apt-get install cups
3.修改配置文件
nano /etc/cups/cupsd.conf
Listen localhost:631改为 Listen 0.0.0.0:631
以下四段配置加入Allow All
# Only listen for connections from the local machine.
Listen 0.0.0.0:631 #原来是localhost:631
Listen /run/cups/cups.sock# Restrict access to the server...
<Location />Order allow,denyAllow all #后面添加的
</Location># Restrict access to the admin pages...
<Location /admin>Order allow,denyAllow all #后面添加的
</Location># Restrict access to configuration files...
<Location /admin/conf>AuthType DefaultRequire user @SYSTEMOrder allow,denyAllow all #后面添加的
</Location># Restrict access to log files...
<Location /admin/log>AuthType DefaultRequire user @SYSTEMOrder allow,denyAllow all #后面添加的
</Location>
4.安装打印驱动
#一般打印机apt-get Install printer-driver-gutenprint
#惠普打印机
apt-get install printer-driver-foo2zjs
- 局域网共享
apt-get -y install avahi-daemon avahi-discover libnss-mdns
6.开机启动
systemctl enable cups
systemctl enable avahi-daemon
- 重启打印服务
#重启cpus服务:
systemctl restart cups
#或者
service cups restart
#我这里使用这个命令
service cups restart
登录用户名是Linux 用户名和密码
文章资料来源:https://www.bilibili.com/video/BV1hi42127fe/