首页 > 其他分享 >docker 运行cups 服务

docker 运行cups 服务

时间:2023-04-15 10:58:09浏览次数:46  
标签:... deny AuthType user allow docker cups Order 运行

主要是一个简单测试,方便学习

环境准备

  • docker-compose
version: "3"
services:
  cups:
    image: olbat/cupsd
    privileged: true
    ports:
      - "632:631"
    volumes:
      - ./cupsd.conf:/etc/cups/cupsd.conf
      - /var/run/dbus:/var/run/dbus
  • 配置cupsd.conf
#
# 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
 
# Allow remote access
Listen *:631
ServerAlias * # 解决打开提示无效的问题,主要是主机解析问题
# Show shared printers on the local network.
Browsing Yes
BrowseLocalProtocols dnssd
 
# Default authentication type, when authentication is required...
DefaultAuthType Basic
DefaultEncryption IfRequested
 
# 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>
 
# Restrict access to log files...
<Location /admin/log>
  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 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>
 
# Set the kerberized printer/job policies...
<Policy kerberos>
  # 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 Negotiate
    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 Negotiate
    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 Negotiate
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>
 
  <Limit All>
    Order deny,allow
  </Limit>
</Policy>
  • 效果

默认有一个用户print,密码也是print

 

 

参考资料

https://github.com/olbat/dockerfiles/blob/master/cupsd/Dockerfile

标签:...,deny,AuthType,user,allow,docker,cups,Order,运行
From: https://www.cnblogs.com/rongfengliang/p/17320664.html

相关文章

  • Python运行过程中想要保存数据
    前言自己写的Python代码循环太多了,想缩减一下迭代步数,但又舍不得之前已经产生的数据。就想去看看这个问题有无解决方案。理论上来说,中途中止看到现在程序运行的情况应该是合理的。所以,就找到了这个知乎问题:参考链接:能不能在手动停止python程序的时候将处理到一半的数据保存出......
  • Docker中使用Nginx部署Web项目
    环境Ubuntu22.04.2LTSdocker安装官网教程Setup [Docker’spackagerepository](https://docs.docker.com/engine/install/ubuntu/#set-up-the-repository).只需要前三步,后面的步骤是安装DockerEngineDownloadlatest DEBpackage.Nginx使用镜像创建一个容器......
  • Ubuntu20.04 Docker搭建远程xfce桌面以及ssh教程
    简介:本文主要介绍ubuntu20.04容器中搭建xfce远程桌面、C++、Go环境、容器内docker操作配置、zsh配置  一、创建容器1、创建容器dockerpull ubuntu:20.04dockerrun-itd--privileged--name=my-desktop--ulimitmemlock=-1:-1--network="network-local"-p22666:22-p......
  • docker_day04:Dockerfile docker私有仓库 dockercompose介绍 dockercompose部署 一件部
    目录回顾Dokerfile常用和不常用命令dockerfile构建一个djagno项目公司中,使用Docker开发的工作流程docker私有仓库镜像传到官方仓库镜像分层私有仓库搭建dockercompose介绍dockercompose部署flask+redis项目新建flask项目app.py编写Dockerfile--->>>用于构建flask项目的镜像编写......
  • repository does not exist or may require 'docker login'
    理论上从docker hub拉取镜像时是不需要的登录,所以就只有一个原因: repositorydoesnotexist仓库类型将私有改成公开 ......
  • 使用cups + ipp 协议client 进行网络打印处理
    实际上日常中我们已经使用了网络打印了(比如公司内部使用的共享打印机),现在大家会有使用基于部分厂商开发的的网络打印进行资料打印从技术实现上基本都是基于网络打印技术,然后通过控制程序对于打印机进行操作,然后平台会按照不同的打印模式收取不同的费用,用户可以自己去固定网点去取......
  • Docker CLI docker compose create常用命令
    Docker是一个开源的应用容器引擎,让开发者可以打包他们的应用以及依赖包到一个可移植的镜像中,然后发布到任何流行的Linux或Windows操作系统的机器上,也可以实现虚拟化。Docker是内核虚拟化,不使用Hypervisor是不完全虚拟化,依赖内核的特性实现资源隔离。本文主要介绍DockerCLI中d......
  • window10专业版系统,在docker中配置oracle19c
    window10专业版系统,在Docker中配置Oracle19c1.环境说明​ 系统:windows10专业版(已打开与wsl相关的服务)​ Docker:Dokcer4.17.0(已为Docker配置环境变量)2.配置流程<1>镜像拉取​ 首先,打开Docker客户端,在cmd中输入以下命令用以镜像拉取(使用命令行拉取镜像会被默认保存至C盘):doc......
  • docker01 flask-sqlalchemy flask-migrate使用 flask项目演示 docker介绍与安装
    今日内容详细目录今日内容详细1flask-sqlalchemy使用2flask-migrate使用3flask项目演示4docker介绍4.1什么是虚拟化4.2docker是什么4.3容器与虚拟机比较4.4Docker概念5docker安装1flask-sqlalchemy使用#集成到flask中,直接使用sqlalchemy,看代码#有个第三方flask-sq......
  • docker03 容器操作 应用部署 迁移备份 dockerfile
    今日内容详细目录今日内容详细1容器操作2应用部署2.1mysql部署2.2redis部署2.3nginx部署3迁移与备份4Dockerfile1容器操作#启动容器 dockerstart容器id#停止容器 dockerstop容器id#文件拷贝 #容器的文件copy到宿主机上(不是在容器内执行)dockercp容......