fix: harden intranet CUPS setup
This commit is contained in:
20
刷机教程.md
20
刷机教程.md
@@ -207,13 +207,13 @@ sysctl -p
|
||||
|
||||
```bash
|
||||
# 方式一:直接运行(最简单)
|
||||
curl -fsSL https://gitee.com/yu-yon/S905L3A/raw/master/setup_cups.sh | bash
|
||||
curl -fsSL https://git.workyai.cn/237899745/S905L3A/raw/branch/master/setup_cups.sh | bash
|
||||
|
||||
# 方式二:使用wget
|
||||
wget -qO- https://gitee.com/yu-yon/S905L3A/raw/master/setup_cups.sh | bash
|
||||
wget -qO- https://git.workyai.cn/237899745/S905L3A/raw/branch/master/setup_cups.sh | bash
|
||||
|
||||
# 方式三:先下载再执行(更安全)
|
||||
curl -fsSL https://gitee.com/yu-yon/S905L3A/raw/master/setup_cups.sh -o setup_cups.sh && chmod +x setup_cups.sh && ./setup_cups.sh
|
||||
curl -fsSL https://git.workyai.cn/237899745/S905L3A/raw/branch/master/setup_cups.sh -o setup_cups.sh && chmod +x setup_cups.sh && ./setup_cups.sh
|
||||
```
|
||||
|
||||
脚本功能:
|
||||
@@ -261,7 +261,7 @@ nano /etc/cups/cupsd.conf
|
||||
修改以下内容:
|
||||
|
||||
```conf
|
||||
# 修改监听地址(允许所有IP访问)
|
||||
# 修改监听地址(允许本机网络访问)
|
||||
Listen 0.0.0.0:631
|
||||
Listen /run/cups/cups.sock
|
||||
|
||||
@@ -269,26 +269,28 @@ Listen /run/cups/cups.sock
|
||||
Browsing Yes
|
||||
BrowseLocalProtocols dnssd
|
||||
|
||||
# 修改访问权限(允许所有网络)
|
||||
# 修改访问权限(仅允许本机和本地网络)
|
||||
<Location />
|
||||
Order allow,deny
|
||||
Allow all
|
||||
Allow @LOCAL
|
||||
</Location>
|
||||
|
||||
<Location /admin>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order allow,deny
|
||||
Allow all
|
||||
Allow @LOCAL
|
||||
</Location>
|
||||
|
||||
<Location /admin/conf>
|
||||
AuthType Default
|
||||
Require user @SYSTEM
|
||||
Order allow,deny
|
||||
Allow all
|
||||
Allow @LOCAL
|
||||
</Location>
|
||||
```
|
||||
|
||||
> **说明**: 内网环境无公网IP,可直接使用 `Allow all`。如需限制访问,可改为 `Allow from 192.168.*.*` 等。
|
||||
> **说明**: `Allow @LOCAL` 适合内网共享,会拒绝非本地网络来源。不要把 CUPS 端口直接暴露到公网。
|
||||
|
||||
### 4.4 将用户添加到打印组
|
||||
|
||||
|
||||
Reference in New Issue
Block a user