矿渣-玩客云-网心云-Iptv-机顶盒-刷了个linux armbian 做 一个 打印机共享服务如此简单

linuxer
发布于 2023-10-18 / 70 阅读
0
0

矿渣-玩客云-网心云-Iptv-机顶盒-刷了个linux armbian 做 一个 打印机共享服务如此简单

玩客云-网心云-Iptv-机顶盒-刷了个linux armbian 装CUPS 做 一个 打印机共享服务如此简单 全网设备可以连接用

方便局域的其他机器链接。。。 可以用 Iptv盒子也可以玩客云 ==== 这些矿渣 都不值钱的东西。。。有需要可以看下 咸鱼店

【闲鱼】https://m.tb.cn/h.5h2Mctx?tk=9o0RWYLb4uT CZ3457

主要用到CUPS 这个软件服务。。

https://openprinting.github.io/cups/

最新软件可以在上面下载

也可以直接系统

安装 CUPS

Ubuntu/debian的 直接

sudo apt install cups

等他跑完码 就安装完了

插上打印机的USB到盒子上 同上电。。。 lsusb 查看一下 打印机是否链接上

这里可以看到我的 爱普生 在了!

安装完 IP:631就应该能打开了。如果不行 打开服务器和更改一下 conf 配置

我的 22.22.22.235:631

如果不行 我们先更改一下 配置文件 cups的配置文件位于/etc/cups/cupsd.conf,所以可以通过

nano /etc/cups/cupsd.conf

修改cups.conf

PS: nano 这是编辑器 你喜欢 你换就行 vi vim ==

主要看修改 红色的

#

# Configuration file for the CUPS scheduler. See "man cupsd.conf" for a

# complete description of this file.

#

# Log general information in error_log - change "warn" to "debug"

# for troubleshooting...

LogLevel warn

PageLogFormat

# Specifies the maximum size of the log files before they are rotated. The value "0" disables log rotation.

MaxLogSize 0

# Default error policy for printers

ErrorPolicy retry-job

# Only listen for connections from the local machine.

Listen 0.0.0.0:631

Listen [::]:631

Listen /run/cups/cups.sock

# Show shared printers on the local network.

Browsing Yes

BrowseLocalProtocols dnssd

# Default authentication type, when authentication is required...

DefaultAuthType Basic

# Web interface setting...

WebInterface Yes

# Timeout after cupsd exits if idle (applied only if cupsd runs on-demand - with -l)

IdleExitTimeout 60

# Restrict access to the server...

<Location />

Order allow,deny

Allow all

</Location>

# Restrict access to the admin pages...

<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>

# Set the default printer/job policies...

<Policy default>

# Job/subscription privacy...

JobPrivateAccess default

JobPrivateValues default

SubscriptionPrivateAccess default

SubscriptionPrivateValues default

# Job-related operations must be done by the owner or an administrator...

<Limit Create-Job Print-Job Print-URI Validate-Job>

Order deny,allow

</Limit>

<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription >

Require user @OWNER @SYSTEM

Order deny,allow

</Limit>

# All administration operations require an administrator to authenticate...

<Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default CUPS-Get->

AuthType Default

如果你把做了DDNS加郁闷 的话 远程添加上去打印也行。。 虽然IPv4也行但要有公网。。 没有的话 折腾比较麻烦。ipv6直接是公网了。。修改完 重启一下 cups

systemctl restart cups  
#上面是重启cups打印机服务的
下面查看一下状态
systemctl status cups

正常的话你就可以看到这个图 有 CUPS状态信息了。。。没有红色 只有绿色 就基本正常了。。。

继续下面操作

登录后进入 Administration 输入 你盒子的 ssh 的账号密码 登录 就可以添加了
添加完打印机 后 本地 电脑试试 看 能不能发现一下 打印机。。

添加不上去就安装一下 打印机驱动把。。。

https://www.openprinting.org/download/PPD/

在上面找到相应的PPD 如果 没有那就找一个相近的 打印机也是马甲多。。

下面是测试打印。。。任务直接在web上吗有记录。。。。

配置电脑使用网络打印

以Windows10为例。

在设置->设备->打印机和扫描仪->添加打印机和扫描仪中应当搜索不到,其原因可能是windows不支持cups默认协议。此时请选择“我需要的打印机不在列表中”,在弹出的窗口选择“按名称选择共享打印机”,输入http://ip:631/printers/打印机名称

我这里搜一下他就出来了。。

我这里Win11它会自动装驱动。。 如果没有可以事先去官方下载你打印机驱动 省事。。

添加完了 就可以打印了。。

可以看到这里打印机用的是ipp协议 这些就不管了 唯一标识符

这里就是打印机的绝对地址!

手机也可以直接连接用

上面是 设置-连接-打印机能发现 到的同网络打印机

下面就去随便一个软件打开 选择分享 打印 就可以了... 连软件驱动啥都不需要了...

还不会的有什么问题的可以进群 大家一起探讨:QQ群226571419


评论