树莓使用CUPS服务配置打印机服务

安装各项软件和进行配置
在树莓派的终端中输入一下代码

sudo su //获取用户权限

apt get update //获取更新状态

apt-get install hplip //安装驱动

apt-get install cups //等待连接CUPS服务器

sudo usermod -a -G lpadmin pi 将用户添加到Ipadmin,pi代表用户名

sudo service cups stop //关闭cups的相关服务

改写配置文件
cd /etc/cups
nano cupsd.conf

# Only listen for connections from the local machine.
#Listen localhost:631#CHANGED TO LISTEN TO LOCAL LAN
Port 631# Restrict access to the server…
<Location />
Order allow,deny
Allow @Local
</Location># Restrict access to the admin pages…
<Location /admin>
Order allow,deny
Allow @Local
</Location># Restrict access to configuration files…
<Location /admin/conf>
AuthType Default
Require user @SYSTEM
Order allow,deny
Allow @Local
</Location>

如果上一段代码无法访问CUPS服务器 请更改为下一段代码

#
# "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $"
#
#   Sample configuration file for the Common UNIX Printing System (CUPS)
#   scheduler.  See "man cupsd.conf" for a complete description of this
#   file.
## Log general information in error_log - change "info" to "debug" for
# troubleshooting...
LogLevel info# Administrator user group...
SystemGroup lpadmin# Only listen for connections from the local machine.
Listen *:631
Listen /var/run/cups/cups.sock# Show shared printers on the local network.
Browsing On
BrowseOrder allow,deny
BrowseAllow all# Default authentication type, when authentication is required...
DefaultAuthType Basic# Restrict access to the server...
<Location />Order allow,denyAllow all
</Location># Restrict access to the admin pages...
<Location /admin># Allow remote administration...Order allow,denyAllow all
</Location># Restrict access to configuration files...
<Location /admin/conf>AuthType DefaultRequire user @SYSTEM# Allow remote access to the configuration files...Order allow,denyAllow all
</Location># Set the default printer/job policies...
<Policy default># Job-related operations must be done by the owner or an administrator...<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 @SYSTEMOrder 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 DefaultRequire user @SYSTEMOrder 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 CUPS-Accept-Jobs CUPS-Reject-Jobs>AuthType DefaultRequire user @SYSTEMOrder deny,allow</Limit># Only the owner or an administrator can cancel or authenticate a job...<Limit Cancel-Job CUPS-Authenticate-Job>Require user @OWNER @SYSTEMOrder deny,allow</Limit><Limit All>Order deny,allow</Limit>
</Policy>#
# End of "$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $".
#
  • 改写完后记得ctrl+O进行写入保存,回车后ctrl+X退出
    修改完后重新启动cups服务
    sudo service cups restart

  • 在树莓派浏览器中输入
    http://树莓派的IP:631

访问时可能会出现网页不安全警告,一般无需理会,继续访问

提示你输入用户和密码时则直接使用树莓派管理员用户登录即可。

登录后选择Administartion

子选项中有Add Printer选择,点进去后就能看见USB连接到树莓派的打印机,注意勾选打印机的序号,下面的网络协议可以不勾选。

进入配置名字和用户组的界面时需要勾选最下方的Share This Printer。点击continue

在Model中勾选打印机需要的对应驱动,点击Add Printer

在同一局域网内,window能够直接检索到已配置的打印机

在设备-打印机和扫描仪-添加设备-添加已连接树莓派的打印机

如果无法刷新出打印机则参考下述步骤

填入http://树莓派IP:631/printers/CUP中配置的打印机名称

等待驱动安装完成后即可使用内网连接直接打印文件

树莓使用CUPS服务搭建打印机服务器相关推荐

  1. 打印机服务器虚拟端口,打印机服务器虚拟端口设置

    打印机服务器虚拟端口设置 内容精选 换一换 通过指定水印模板ID删除用户自定义的水印模板. 实例常用端口如表1所示.您可以通过配置安全组规则放通实例对应的端口,详情请参见配置安全组规则.无法访问公有云 ...

  2. React 项目搭建与部署,搭建Node服务器

    环境配置与项目搭建 安装node,官网 直接下载 安装webpack : npm install -g webpack 安装淘宝镜像(可选): npm install -g cnpm --regist ...

  3. ubuntu搭建cups打印机服务器

    ubuntu搭建cups打印机服务器 ubuntu环境搭建 所有操作都是在root账户下执行的,进入root命令 sudo su - 1.安装 apt install cups aptitude ap ...

  4. sftp进入指定目录_CentOS7服务搭建----搭建SFTP(安全文件传送协议)服务器

    SFTP协议服务器 简介: sftp是Secure File Transfer Protocol的缩写,安全文件传送协议.可以为传输文件提供一种安全的加密方法.sftp 与 ftp有着几乎一样的语法和 ...

  5. 利用金山快盘云服务搭建自己的SVN服务器

    我是程序员,一般习惯使用svn来管理自己的代码,连带着,我很多历史性文档,也都丢在svn服务器里面. 但这里有个问题,我单位一台机器,家里一台机器,同步起来很不方便,老是U盘带来带去,容易丢不说,代码 ...

  6. RHEL4- SAMBA服务(四)在x-window下图形界面简单搭建samba服务器

    RHEL4- SAMBA服务(四)在x-window下图形界面简单搭建samba服务器       在<RHEL4- SAMBA服务(一)samba服务的安装与启动>中我讲了如何安装和启动 ...

  7. 一、服务端开发基础(搭建Web服务器、网络基础概念、请求响应流程、配置Apache、静态网站与动态网站)

    一.建立你的第一个网站(目标) 前端开发 最终还是属于 Web 开发 中的一个分支,想要成为一名合格的前端开发人员,就必须要 充分理解Web 的概念. 构建一个专业的网站是一项巨大的工作!对于新手我们 ...

  8. linux dns服务无效,Linux下搭建DNS服务器及踩坑

    DNS服务 域名系统(DNS)是建立在分布式数据库上的分层命名系统.该系统将域名转换为IP地址,并可以将域名分配给Internet组资源和用户,无论实体的物理位置如何. 说白了就是:域名与IP之间的相 ...

  9. Linux7中安装DNS服务,CentOS7/RHEL7搭建DNS服务器

    CentOS7/RHEL7搭建DNS服务器 DNS(域名系统)主要用于域名与IP地址的相互转换,将IP地址转换成对应的主机名或将主机名转换成与之相对应IP地址的一种机制.通过域名解析出IP地址的叫做正 ...

最新文章

  1. 必读 | 在转行AI之前,先了解下2018年人工智能发展的八大趋势
  2. Python中enumerate用法详解
  3. Migw用CMD编译C语言,NOTEPAD++用MinGW编译C,C++语言
  4. unity3d 求两个点长度_用Scratch3.0模拟求π的近似值(二) #寻找真知派#
  5. [bzoj1009](HNOI2008)GT考试 (kmp+矩阵快速幂加速递推)
  6. 《架构之美》阅读笔记06
  7. python代码转换为pytorch_python基础教程Pytorch之Tensor和Numpy之间的转换的实现方法...
  8. IO流 (二) ----- 文件流
  9. SQL Server分组查询某最大值的整条数据(包含linq写法)
  10. Word转换pdf文件之好用的pdf虚拟打印机
  11. 神舟七号飞船应用计算机进行飞行状态属于,“神舟七号”飞船应用计算机进行飞行状态调整属于()。...
  12. html背景半透明 字不变,css实现背景半透明文字不透明的效果示例
  13. 关于SVN报错问题错误码E175002的解决方案
  14. 柱状图怎么设置xy轴_经验-Origin做柱状图常遇问题-柱状图X坐标轴如何设置—小技巧...
  15. java程序 扑克牌概率_java扑克牌洗牌程序,求抽可以抽出特定牌的次数
  16. 交换机工作原理和配置命令
  17. Maven自动更新SNAPSHOT包
  18. gpd计算机等级,GPD 文件扩展名: 它是什么以及如何打开它?
  19. C++ Win32程序编写入门
  20. 微信网页分享给朋友或朋友圈只有url链接

热门文章

  1. 清华计算机科学四字班,清华大学里四个特殊班
  2. 一卡通变“一脸通”,人脸识别让校园更安全
  3. 中国老百姓一生要交多少税?
  4. sap清账使用反记账_SAP反记账功能祥解
  5. jQuery---什么是jQuery
  6. xmind 文件 打开后会在当前目录生成 configuration,p2和workspace目录,artifacts.xml文件 解决
  7. 永恒之蓝ms17_010漏洞
  8. 阿里云 免费领服务器 具体步骤
  9. 输入一个字符,将大写字母换小写,小写变大写
  10. 不畏将来,不念过往,如此安好