Ubuntu下使用cups共享打印机, 是一种简单易用的方法。CUPS(Common UNIX Printing System,通用Unix打印系统)是Fedora Core3中支持的打印系统,它主要是使用IPP(Internet Printing Protocol)来管理打印工作及队列,但同时也支持"LPD"(Line Printer Daemon)和"SMB"(Server Message Block)以及AppSocket等通信协议。(From baike.baidu.com)

CUPS - 打印服务器

Ubuntu 印刷和打印服务的主要机制是 CUPS (Common UNIX Printing System,通用 UNIX 打印系统)。这个打印系统是一个免费可用的、可移植的打印虚拟层,并已成为大多数 Linux 发行版的新打印标准。

CUPS 管理打印作业和队列,并使用标准的 Internet 打印协议 (IPP) 提供网络打印,该协议提供最大范围的打印机支持,从点阵打印机到激光打印机以及位于两者之间的许多打印机。CUPS 也支持 PostScript Printer Description (PPD) 和网络打印机的自动检测,以及提供基于 Web 的简单配置和管理工具。

安装

配置

Web Interface

参考资料

安装

To install CUPS on your Ubuntu computer, simply use sudo with the apt command and give the packages to install as the first parameter. A complete CUPS install has many package dependencies, but they may all be specified on the same command line. Enter the following at a terminal prompt to install CUPS:

sudo apt install cups

Upon authenticating with your user password, the packages should be downloaded and installed without error. Upon the conclusion of installation, the CUPS server will be started automatically.

For troubleshooting purposes, you can access CUPS server errors via the error log file at: /var/log/cups/error_log. If the error log does not show enough information to troubleshoot any problems you encounter, the verbosity of the CUPS log can be increased by changing the LogLevel directive in the configuration file (discussed below) to "debug" or even "debug2", which logs everything, from the default of "info". If you make this change, remember to change it back once you've solved your problem, to prevent the log file from becoming overly large.

配置

可以通过 /etc/cups/cupsd.conf 文件中的指令来配置通用 UNIX 打印系统服务器的行为的。CUPS 配置文件与 Apache HTTP 服务器的主配置文件语法相同,因此熟悉编辑 Apache 配置文件的用户在编辑 CUPS 配置文件时会感到相当容易。在这里将显示一些您可能想要改变初始值的设置范例。

在编辑配置文件之前,您应该将原始文件做个副本并将其写保护,以便您可以将原始文件作为参考并在必要时重用它。

拷贝 /etc/cups/cupsd.conf 文件并对其写保护,可以在终端提示符后执行以下命令:

sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original
sudo chmod a-w /etc/cups/cupsd.conf.original
  1. ServerAdmin: To configure the email address of the designated administrator of the CUPS server, simply edit the /etc/cups/cupsd.conf configuration file with your preferred text editor, and add or modify the ServerAdmin line accordingly. For example, if you are the Administrator for the CUPS server, and your e-mail address is 'bjoy@somebigco.com', then you would modify the ServerAdmin line to appear as such:

    ServerAdmin bjoy@somebigco.com

  2. Listen: By default on Ubuntu, the CUPS server installation listens only on the loopback interface at IP address 127.0.0.1. In order to instruct the CUPS server to listen on an actual network adapter's IP address, you must specify either a hostname, the IP address, or optionally, an IP address/port pairing via the addition of a Listen directive. For example, if your CUPS server resides on a local network at the IP address 192.168.10.250 and you'd like to make it accessible to the other systems on this subnetwork, you would edit the /etc/cups/cupsd.conf and add a Listen directive, as such:

Listen 127.0.0.1:631 # existing loopback Listen
Listen /var/run/cups/cups.sock # existing socket Listen
Listen 192.168.10.250:631 # Listen on the LAN interface, Port 631 (IPP)

在上面的例子里,如果您不想 cupsd 监听环回地址 (127.0.0.1) ,您可能注释或删除了相关语句。但最好保留它以监听局域网 (LAN) 的以太网接口。为了能监听一个特定主机名所绑定的所有的网络接口,您可以为 socrates 主机名创建一个 Listen 条目,如下所示:

Listen socrates:631 # Listen on all interfaces for the hostname 'socrates'

或者忽略 Listen 语句并使用 Port 来代替,如:

Port 631 # Listen on port 631 on all interfaces

关于 CUPS 服务器配置文件中配置语句的更多范例,通过在终端提示符后输入以下命令可以查阅相关的系统手册页:

man cupsd.conf

无论您在什么时间修改了 /etc/cups/cupsd.conf 配置文件,您都需要重启 CUPS 服务,在终端提示符后键入以下命令:

sudo systemctl restart cups.service

Web Interface

CUPS can be configured and monitored using a web interface, which by default is available at http://localhost:631/admin. The web interface can be used to perform all printer management tasks.

In order to perform administrative tasks via the web interface, you must either have the root account enabled on your server, or authenticate as a user in the lpadmin group. For security reasons, CUPS won't authenticate a user that doesn't have a password.

To add a user to the lpadmin group, run at the terminal prompt:

sudo usermod -aG lpadmin username

Further documentation is available in the Documentation/Help tab of the web interface.

在http://localhost:631/admin页面中找到Server Settings,选择"Share printers connected to this system"及其子项"Allow printing from the Internet",点击"Change Setting"按钮保存设置。

进入http://localhost:631/printers/页面点击自己打印机的名字,复制跳转到的页面的URL,即打印机的地址。然后,就可以在Windows上添加使用Ubuntu共享的打印机了。

参考资料

CUPS 网络

Debian Open-iSCSI page

参考文献

1.http://www.cnblogs.com/yuxc/archive/2012/03/01/2375846.html

2.http://www.360doc.com/content/10/0705/12/254935_37021593.shtml

3.https://help.ubuntu.com/lts/serverguide/cups.html

在Windows上使用Ubuntu共享的打印机的更多相关文章

  1. 怎么把Windows主机上的目录共享到Ubuntu上

    使用Oracle VM VirtualBox在Windows主机上创建了一台Ubuntu虚拟机,怎么把宿主机上的目录共享到Ubuntu上,可使用以下方法: eg.把Windows主机上D盘里的test ...

  2. windows7使用Source insight上远程修改ubuntu共享内核源码

    由于本人阅读喜欢使用source insight.前段时间接触了linux核代码,而这份代码只能放在ubuntu服务器上编译,刚开始的时候是在windows上修改,完了之后再copy到服务器上去编译, ...

  3. windows7使用Source insight上远程改动ubuntu共享内核源代码

    因为本人阅读喜欢使用source insight.前段时间接触了linux核代码,而这份代码仅仅能放在ubuntuserver上编译.刚開始的时候是在windows上改动,完了之后再copy到serv ...

  4. 在ubuntu on windows 上安装jekyll

    已知问题 安装ruby之后,重新启动ubuntu on windows,输入ruby命令,提示找不到. 发现的解决办法 执行下面命令 source /home/xxxx/.rvm/scripts/rv ...

  5. Windows系列之(一):Windows10 上运行Ubuntu Bash

    1. 前言 2016年4月6日,Windows 10 Insider Preview 发布的版本 14316,添加了Ubuntu Bash,在Windows上提供一个Linux环境,可以直接执行Lin ...

  6. Ubuntu安装SSH + Windows上配置Putty

    1. Ubuntu安装SSH 命令: # sudo apt-get install openssh-server 2. 启动SSH Server 命令: # sudo /etc/init.d/ssh ...

  7. golang 跨平台编译——go 在windows上编译Linux平台的程序(Cross Compilation from Windows to Linux/Ubuntu)

    Go Cross Compilation from Windows to Linux/Ubuntu I have GO 1.7 installed on my Windows 10. I create ...

  8. windows 10上玩耍ubuntu

    win10 已经支持运行子系统ubuntu了. 安装ubuntu 程序和功能>>启用或关闭Windows功能>>勾选"适用于Linux的Windows子系统" ...

  9. Windows单击右键没有共享选项怎么办

    文件共享是指在网络环境下文件.文件夹.某个硬盘分区使用时的一种设置属性,一般指多个用户可以同时打开或使用同一个文件或数据.但有时候也会遇到找不到共享选项的情况. Windows单击右键没有共享选项怎么 ...

随机推荐

  1. Spring阅读方法

    转自:http://www.cnblogs.com/xing901022/p/4178963.html 最近没什么实质性的工作,正好有点时间,就想学学别人的代码.也看过一点源码,算是有了点阅读的经验, ...

  2. css 的包含块 、负外边距,字体,文本行高

    一.包含块 目的:确定元素的位置和相对大小(%) 1.正常文档流元素和浮动元素 ---- 父元素的 content-box 2.绝对定位元素 ---- 父元素的 padding-box 3.固定定位元 ...

  3. iOS耗电量测试

    iOS耗电量测试 本文主要介绍的是使用Energy Diagnostics Instruments来进行iOS耗电量测试. 一.使用方法: 1)iOS 设置选项 ->开发者选项 ->log ...

  4. MongoDB数据库的数据类型和$type操作符

    前面的话 本文将详细介绍MongoDB数据库的数据类型和$type操作符 数据类型 MongoDB支持以下数据类型 类型 数字 备注 Double 1 双精度浮点数 - 此类型用于存储浮点值 Stri ...

  5. [补档][NOI 2008]假面舞会

    [NOI 2008]假面舞会 题目 一年一度的假面舞会又开始了,栋栋也兴致勃勃的参加了今年的舞会.今年的面具都是主办方特别定制的.每个参加舞会的人都可以在入场时选择一个自己喜欢的面具. 每个面具都有一 ...

  6. Mybatis 调用存储过程,使用Map进行输入输出参数的传递

    做个记录,以备后用 java代码: public String texuChange() throws Exception {        try {                         ...

  7. WCF项目的架构设计

    本文将介绍以WCF开发项目为主的架构设计,主要从类库的分类和代码的结构. 下面将以一个WCF实例做具体的介绍.此项目底层是一个Windows Service,WCF服务Hosted在此Windows ...

  8. mysql 查询性能优化第一章 为什么查询速度会慢

    一 为什么查询速度会慢 在尝试编写快速的查询之前,咱们需要清除一点,真正重要的是响应时间.如果把查询看成是一个任务,那么它由一系列子任务组成,每个子任务都会消耗一定的时间.如果要有 优化查询,实际上要 ...

  9. "=="和equals方法究竟有什么区别?

    (单独把一个东西说清楚,然后再说清楚另一个,这样,它们的区别自然就出来了,混在一起说,则很难说清楚) ==操作符专门用来比较两个变量的值是否相等,也就是用于比较变量所对应的内存中所存储的数值是否相同, ...

  10. 如何开发自己的搜索帝国之安装ik分词器

     Elasticsearch默认提供的分词器,会把每个汉字分开,而不是我们想要的根据关键词来分词,我是中国人 不能简单的分成一个个字,我们更希望 “中国人”,“中国”,“我”这样的分词,这样我们就需要 ...