如何配置 cups 以允许远程打印带身份验证和本地打印不带?

Jef*_*unk 5 cups

根据cupsd.conf 文档,应该能够“要求对远程访问进行身份验证,但允许无需身份验证的本地访问”。似乎没有关于此主题的任何其他文档。

我尝试将以下内容放入我的 cupsd.conf 中:

<Location />
  # Restrict access to the server...
  Allow from 192.168.1.0/24
  Require valid-user
  Satisfy any
  Order allow,deny
</Location>
Run Code Online (Sandbox Code Playgroud)

它对我不起作用。

有没有人让这个工作?此配置是否有可用的示例 cupsd.conf?

Kur*_*fle 4

将以下行添加到您的代码片段中:

Allow from localhost
Allow from 127.0.0.1
Deny from all
Run Code Online (Sandbox Code Playgroud)

并将该Order行更改为

Order deny,allow
Run Code Online (Sandbox Code Playgroud)

所以它写道:

<Location />
   # Restrict access to the server 'root' location...
   Allow from 192.168.1.0/24
   Allow from localhost
   Allow from 127.0.0.1
   Deny from all
   Require valid-user
   Satisfy any
   Order deny,allow
 </Location>
Run Code Online (Sandbox Code Playgroud)

如果这还不够,请为<Location /printers>和添加相同的设置</Location /admin>

<Location /printers>
   # Restrict access to the server's shared printers...
   Allow from 192.168.1.0/24
   Allow from localhost
   Allow from 127.0.0.1
   deny from all
   Require valid-user
   Satisfy any
   Order deny,allow
 </Location>
Run Code Online (Sandbox Code Playgroud)