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)html
Ubuntu 印刷和打印服務的主要機制是 CUPS (Common UNIX Printing System,通用 UNIX 打印系統)。這個打印系統是一個免費可用的、可移植的打印虛擬層,並已成爲大多數 Linux 發行版的新打印標準。web
CUPS 管理打印做業和隊列,並使用標準的 Internet 打印協議 (IPP) 提供網絡打印,該協議提供最大範圍的打印機支持,從點陣打印機到激光打印機以及位於二者之間的許多打印機。CUPS 也支持 PostScript Printer Description (PPD) 和網絡打印機的自動檢測,以及提供基於 Web 的簡單配置和管理工具。ubuntu
安裝
配置
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
app
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.socket
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.ide
能夠經過 /etc/cups/cupsd.conf 文件中的指令來配置通用 UNIX 打印系統服務器的行爲的。CUPS 配置文件與 Apache HTTP 服務器的主配置文件語法相同,所以熟悉編輯 Apache 配置文件的用戶在編輯 CUPS 配置文件時會感到至關容易。在這裏將顯示一些您可能想要改變初始值的設置範例。工具
在編輯配置文件以前,您應該將原始文件作個副本並將其寫保護,以便您能夠將原始文件做爲參考並在必要時重用它。
拷貝 /etc/cups/cupsd.conf 文件並對其寫保護,能夠在終端提示符後執行如下命令:oop
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.original sudo chmod a-w /etc/cups/cupsd.conf.original
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
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
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