CentOS CUPS 配置

CentOS CUPS 配置

我有一个关于为 CentOS 配置 CUPS 的问题。我在一台机器上的 CentOS 上安装了 CUPS,我正尝试从另一台机器访问 CUPS 的 Web 界面。装有 CentOS 和 CUPS 的机器的 IP 为 10.0.0.1,第二台机器的 IP 为 10.0.0.2。我有一个网络打印机,其 IP 为 10.0.0.10,两台机器都可以 ping 通打印机。但第二台机器无法通过 Web 界面访问 CentOS 机器。

下面是我的 cupsd.conf 文件的一部分:

SystemGroup sys root

Listen *:631
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseAddress 10.0.0.2:631

<Location />
    Order allow,deny
    Allow from 10.0.0.2
</Location>

<Location /admin>
    Order allow,deny
    Allow from 10.0.0.2
</Location>

<Location /admin/conf>
    AuthType Default
    Require user @SYSTEM
    Order allow,deny
    Allow from 10.0.0.2
</Location>

我还在某处看到说 CentOS 的 CUPS 需要 SSL 证书,这是真的吗?

答案1

CUPS 不需要 SSL 证书。您可以通过添加DefaultEncryption Never到配置文件并重新启动守护程序来禁用 https。在较新版本的 CentOS(您没有指定正在运行的版本)中,Web 界面中有一个“允许远程管理”复选框,它将在端口 631 上提供远程 CUPS 管理页面访问。对于您来说,请浏览到:https://10.0.0.1:631/admin

这是我倾向于在新系统上部署的标准 CUPS 文件。

MaxLogSize 2000000000
LogLevel info
SystemGroup sys root
# Allow remote access
Port 631
Listen /var/run/cups/cups.sock
# Disable printer sharing and shared printers.
Browsing Off
DefaultAuthType Basic
<Location />
  Allow ALL
  Allow all
  # Allow remote administration...
  Order allow,deny
  Allow all
</Location>
<Location /admin>
  Allow ALL
  Allow all
  # Allow remote administration...
  Order allow,deny
  Allow all
</Location>
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Allow ALL
  Allow all
  # Allow remote access to the configuration files...
  Order allow,deny
  Allow all
</Location>
<Policy default>
  <Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit Pause-Printer Resume-Printer Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>
  <Limit CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
DefaultEncryption Never

相关内容