ubuntu安装cups打印机服务,并配置权限
1 安装
sudo apt install cups
sudo systemctl start cups
sudo systemctl enable cups
systemctl status cups\
2 配置
sudo vim /etc/cups/cupsd.conf
修改以下内容
# Only listen for connections from the local machine.
Port 631
Listen /run/cups/cups.sock
# Show shared printers on the local network.
Browsing Yes
BrowseLocalProtocols dnssd
<Location />
Allow from 192.168.2.17
Order allow,deny
</Location>
# Restrict access to the admin pages...
<Location /admin>
Order allow,deny
Allow from 192.168.2.17
</Location>
# Restrict accessAuthType Default
<Location /admin/conf>
Allow from 192.168.2.17
Order allow,deny
</Location>
# Restrict access to log files...
<Location /admin/log>
Order allow,deny
Allow from 192.168.2.17
</Location>
3 添加权限
sudo usermod -aG lpadmin $USER
4 日志查看,如果使用过程中需要查看日志
sudo tail -f /var/log/cups/error_log