我正在尝试配置 CUPS 以允许通过 Web 界面进行远程管理。足够的文档出去那里那我可以弄清楚在我的部分中需要进行哪些更改(cupsd.conf
更改Listen localhost:631
为Port 631
,并添加Allow @LOCAL
到/
和部分)。/admin
/admin/conf
现在,我可以从同一网络上的另一台机器上看到 CUPS 界面。问题是,当我尝试时Add Printer
,系统会要求我输入用户名和密码,但我的响应被拒绝,即使我知道我输入的是正确的(我假设它要求输入lpadmin
服务器机器上某个组中的某个人的用户名和密码;我已ssh
使用被拒绝的凭据登录,并且我使用的用户已添加到该lpadmin
组中)。
如果我通过更改DefaultAuthType Basic
为直接禁用身份验证DefaultAuthType None
,则当我尝试 时会收到“未授权”错误而不是密码请求Add Printer
。
我做错了什么?有没有办法让本地网络的用户通过 CUPS Web 界面管理打印服务器?
编辑第二篇:
我现在已经在两台不同的机器上测试了相同的配置更改(首先是 Debian Squeeze 机箱,然后是另一台 Wheezy 机箱,以确保万无一失),上面的配置文件在它们上运行良好。除了 中包含的内容之外,还有其他权限/端口设置可能会影响 CUPS 远程管理吗cupsd.conf
?这是否足够具体,我应该去问unix.se
?
编辑:
根据要求,我的完整版cupsd.conf
(剧透:来自 Debian wheezy repos 的 CUPS 版本附带的经过最少编辑的默认配置文件):
LogLevel warn
MaxLogSize 0
SystemGroup lpadmin
Port 631
# Listen localhost:631
Listen /var/run/cups/cups.sock
Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS dnssd
# DefaultAuthType Basic
DefaultAuthType None
WebInterface Yes
<Location />
Order allow,deny
Allow @LOCAL
</Location>
<Location /admin>
Order allow,deny
Allow @LOCAL
</Location>
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow @LOCAL
</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 Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
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-Devices>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
# All printer operations require a printer operator to authenticate...
<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 Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
# Only the owner or an administrator can cancel or authenticate a job...
<Limit Cancel-Job CUPS-Authenticate-Job>
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>
<Limit All>
Order deny,allow
</Limit>
</Policy>
# Set the authenticated printer/job policies...
<Policy authenticated>
# 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>
AuthType Default
Order deny,allow
</Limit>
<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 Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
AuthType Default
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>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
# All printer operations require a printer operator to authenticate...
<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 Cancel-Jobs CUPS-Accept-Jobs CUPS-Reject-Jobs>
AuthType Default
Require user @SYSTEM
Order deny,allow
</Limit>
# Only the owner or an administrator can cancel or authenticate a job...
<Limit Cancel-Job CUPS-Authenticate-Job>
AuthType Default
Require user @OWNER @SYSTEM
Order deny,allow
</Limit>
<Limit All>
Order deny,allow
</Limit>
</Policy>
答案1
它通常要求输入 CUPS 服务器的根用户/密码。
请向我们展示您的 cupsd.conf 配置文件。
答案2
使用 passwd 配置 root 的密码。然后尝试从 root 用户访问 url。
答案3
我认为我已经找到解决问题的方法。在本节中:
# 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-Devices>
AuthType Default
Require user @SYSTEM
Order deny,allow
将“AuthType Default”更改为“AuthType None”,您可能还希望将此更改应用于涉及配置打印机和管理作业的所有其他部分。
希望这可以帮助 :)