SlideShare a Scribd company logo
1 of 40
Printing with CUPS
CUPS (COMMON UNIX PRINTING SYSTEM)
A printing system handles the tasks involved in getting a print job from an application
(or the command line) through the appropriate filters
LPD and LPR Traditionally, UNIX had two printing systems: the BSD Line Printer Daemon (LPD)
and the System V Line Printer system (LPR). Linux adopted these systems at first, and both UNIX
and Linux have seen modifications to and replacements for these systems. Today CUPS is the
default printing system under Fedora/RHEL.
1. CUPS CUPS (Common UNIX Printing System) is a cross-platform print server built around IPP
(next).
2. CUPS provides many printer drivers and can print different types of files, including PostScript.
3. Because it is built on IPP and written to be portable, CUPS runs under many operating
systems, including Linux and Windows. Other UNIX variants, including Mac OS X, use CUPS;
recent versions of Windows include the ability to print to IPP printers.
4. Thus CUPS is an ideal solution for printing in a heterogeneous environment.
5. CUPS provides System V and BSD command-line interfaces and, in addition to IPP, supports
LPD/LPR, HTTP, SMB, and JetDirect (socket) protocols, among others.
Network printers Printers connected directly to a network are functionally equivalent to printers
connected to a system running a print server: They listen on the same ports as systems running
print servers, and they queue jobs.
Printers and queues On a modern computing system, when you “send a job to the printer,” you
actually add the job to the list of jobs waiting their turn to be printed on a printer. This list is
called a print queue or simply a queue. The phrase configuring (or setting up) a printer is often
used to mean configuring a (print) queue. This chapter uses these phrases interchangeably.
Prerequisites:
Make sure the following packages are installed (most are installed with the base Fedora/RHEL
system):
• cups
• system-config-printer (optional)
• cups-pdf (optional; Fedora only; sets up a virtual PDF printer)
The CUPS Web interface requires an X server and a Web browser. Although it is a poor solution,
a text Web browser such as elinks (elinks package) will work too.
cups init script Run chkconfig to cause CUPS (the cupsd daemon) to start when the system goes
into
multiuser mode:
# chkconfig cups on
Start CUPS:
# service cups start
Firewall A CUPS server normally uses TCP port 631 for an IPP connection and port 80 for
an LPR/LPD connection. If the CUPS server system accepts print jobs from remote
systems and is running a firewall, you need to open one or both of these ports.
PDF printer You can set up a virtual PDF printer by installing the cups-pdf package, or you can
set up this printer manually.
Configuring a Printer Using system-config-
printer
Main menu: System Administration Printing (RHEL) or give the command
systemconfig-printer from a terminal emulator or Run Application window (ALT-F2).
Default printer Highlight a printer in the Printing window and select menubar: Printer Set as
Default from the window menu to specify the highlighted printer as the default printer. If just
one printer appears in the Printing window, it is the default printer; you do not have to set it up
as such.
Server Settings Select menubar: Server Settings from the Printing window to display the Server
Settings window. The top two check boxes in this window specify whether systemconfig-
printer displays printers that are shared by other systems and whether the local system
publishes printers it shares. You control whether a specific printer is shared from the Policies
selection of the Printer Properties window (next).
Configuration Selections
Select menubar: Printer Properties to display the Printer Properties window
This section describes the six selections found in the frame at the left side of the
Printer Properties window. These selections allow you to configure the printer you
chose in the Printing window
The text boxes labeled Description and Location hold information that can help users identify
The printer. The system does not use this information; change it as you like. For example,
it might be helpful to put the physical location of the printer, such as Sam’s Office, in the text
box labeled Location. The text boxes labeled Device URI and Make and Model specify the
location of the printer on the computer or network and type of the printer.
Policies The Policies selection enables you to control printer state, sharing, and banners.
Under the word State are check boxes labeled Enabled, Accepting jobs, and Shared.
Putting a tick in the check box labeled Shared shares the printer with other systems if the
local system publishes shared printers (see “Server Settings”). The Policies tab also controls
whether the printer prints banners before and after jobs and what CUPS does when the printer
reports an error.
Access Control The Access Control selection enables you to set the policy for printer access. By
default, anyone can use the printer. To restrict access, you can create a blacklist of
users who are not allowed to use it. Alternatively, you can prohibit anyone from
using the printer and then create a whitelist of users who are allowed to use it.
Printer Options The Printer Options selection controls image quality, paper size and source
(tray), and other generic printer options.
Setting Up a Local or Remote Printer
This section describes how to set up three types of printers for local use: a printer
attached to the local system, a printer hosted by another system, and a printer that
resides on the local network (a network printer).
The system-config-printer utility looks for printers attached to the system or the local network. It
then asks if you want to adjust the firewall so the local system can detect printers on the
network (Fedora only) and displays the New Printer window
Specifying a URI The easiest way to locate a remote printer that is not listed is to select Find
Network Printer under Network Printer in the frame labeled Select Device. Then enter in the
text box labeled Host the name of the host the printer is attached to (the server) or,
for a network printer, the name of the printer. You can specify an IP address instead of
a hostname.
Click Find. If it finds a printer, system-config-printer displays the name of
the printer under Network Printer and fills in information about the printer on the
right side of the window.
If the printer is not listed, select Other (for a local printer) or one of the selections
under Network Printer (for a remote printer) from the frame labeled Select Device;
system-config-printer displays appropriate text boxes on the right side of the window.
All selections under Network Printer require you to specify a Host and a Queue or
Port number. These values locate the printer on the network.
To specify the queue for an LPD/LPR printer, use the form printer-name; for an IPP
printer, use the form /printers/printer-name; for an HP JetDirect-compatible network
printer, specify the printer-name and Port number. Replace printer-name with the
name of the printer on the server.
If you are unsure of the name of a printer, give the command lpstat –p on the server to
display the names of all printers on that system. After selecting or specifying a printer,
click the button labeled Verify (if present) to make sure the printer is accessible and
then click Forward. The system-config-printer utility searches for the printer driver.
At this point, the system-config-printer utility closes the New Printer window, asks if
you want to print a test page, and displays the new printer in the Printing window.
If you have more than one print queue and want to set up the new print queue to be
the default, highlight the printer and select menubar: Printer Set As Default
Sharing CUPS Printers
Display the Server Settings window by selecting menubar: Server Settings and put a tick in the
Check box labeled Publish shared printers connected to this system. Using this technique
allows you to chose whether to share each printer.
IPP facilitates remote printing. The Listen directive in the CUPS configuration file,
/etc/cups/cupsd.conf, specifies which IP address and port or which domain socket path
CUPS binds to and accepts requests on. The Listen directive has the following format:
Listen IP:port | path
where IP is the IP address that CUPS accepts connections on, port is the port number
that CUPS listens on for connections on IP, and path is the pathname of the domain
socket CUPS uses to communicate with printers. CUPS typically uses port 631 and by
default binds to localhost. Thus it accepts connections from the loopback service of
the local system only. CUPS uses /var/run/cups/cups.sock, a local domain socket, to
communicate with local printers. It can also use a Port directive to specify the port
number it listens to for HTTP requests.
$ grep -i listen /etc/cups/cupsd.conf
# Only listen for connections from the local machine.
Listen localhost:631
Listen /var/run/cups/cups.sock
To allow other systems to connect to the CUPS server on the local system, you must
instruct CUPS to bind to an IP address that the other systems can reach. First
remove or comment out the Listen localhost:631 directive; leave the other Listen
directive in place:
# Listen localhost:631
Listen /var/run/cups/cups.sock
In place of the commented-out Listen directive, use an access control list to permit
only selected machines to connect to local printers. An access control list is
defined inside a <Location> container (see page 934 for the Apache equivalent).
The following example allows only the system at IP address 192.168.1.101 and
the local system to print to the specified printer.
<Location />
Order Allow,Deny
# Allow access from the local system and 192.168.1.101
Allow from localhost
Allow from 192.168.1.101
# Uncomment the following line to permit access from all systems
# Allow @LOCAL
</Location>
The @LOCAL macro is internal to CUPS and specifies the local system. This macro
accepts communication from any address that resolves to the local system. Specify
Allow @LOCAL to share the printer with all systems.
Print from Windows
Print Using CUPS
Modern versions of Windows (2000 and later) support IPP and as a result can communicate
directly with CUPS. To use this feature, you must have CUPS configured on
the Linux print server to allow remote IPP printing; you also need to create a new
printer on the Windows system that points to the IP address of the Linux print server
First set up the /etc/cups/cupsd.conf file to allow network printing from a client, as
explained in “Sharing CUPS Printers”
Windows XP From Windows XP, go to Control Panel􀁄Printers and Faxes and click Add Printer.
Click Next in the introductory window and select A network printer or a printer
attached to another computer. Click Next. Select Connect to a printer on the Internet
or on a home or office network. Continue following the next paragraph at
“Enter URL.”
Windows 7 From Windows 7, go to Control Panel􀁄Devices and Printers and click Add a
printer. Click Add a network, wireless, or Bluetooth printer. Assuming Windows
does not find the printer, click The printer that I want isn’t listed. Click the radio
button labeled Select a shared printer by name.
Enter URL Enter the following information in the text box (under Windows XP it is labeled URL):
http://hostname:631/printers/printer-name
where hostname is the name or IP address of the Linux CUPS server system and
printer-name is the name of the printer on that system. For example, for the printer
named dog88 on the system named dog at IP address 192.168.0.12, you could enter
http://dog:631/printers/dog88 or http://192.168.0.12:631/printers/dog88. If you
use a hostname, it must be defined in the hosts file on the Windows machine. Click
Next. Windows requests that you specify the manufacturer and model of printer or
provide a driver for the printer. If you supply a printer driver, use the Windows version
of the driver.
Print Using Samba
Samba must be set up so that the Windows user who will be printing is mapped to a
Linux user (including mapping the Windows guest user to the Linux user nobody).
Windows supports printer sharing via SMB, which allows a printer to be shared
transparently between Windows systems using the same mechanism as file sharing.
Samba allows Windows users to use printers connected to Linux systems just as
they would use any other shared printers
When you use rpm to install Samba, it creates a directory named /var/spool/samba
that is owned by the root account and that anyone can read from and write to
$ ls -ld /var/spool/samba
drwxrwxrwt. 2 root root 4096 02-03 15:23 /var/spool/samba
Under Fedora, put the following two lines in the [global] section of the /etc/samba/smb.conf
file. Under RHEL, these lines are set up by default, you need only change the printcap name as
shown.
[global]
...
printing = cups
printcap name = cups
The printer’s share is listed in the [printers] section in smb.conf. In the following
example, the path is the path Samba uses as a spool directory and is not a normal
share path. The settings allow anyone, including guest, to use the printer. The
[printers] section in the default smb.conf file has the following entries, which are
appropriate for most setups:
[printers]
comment = All Printers
path = /var/spool/samba
browseable = no
guest ok = no
writable = no
printable = yes
Printing to Windows
CUPS views a printer on a Windows machine exactly the same way it views any
other printer. The only difference is the URI you need to specify when connecting it.
To configure a printer connected to a Windows machine, click the Administration
tab in the CUPS Web interface and select Add Printer, just as you would for a local
printer.
When you are asked to select the device, choose Windows Printer via SAMBA.
Enter the URI of the printer in the following format:
smb://windows_system/printer_name
where windows_system can be an IP address or a hostname. After you have added
the printer, you can use it as you would any other printer.

More Related Content

What's hot

chapter 1 introduction to operating system
chapter 1 introduction to operating systemchapter 1 introduction to operating system
chapter 1 introduction to operating systemAisyah Rafiuddin
 
evaluation techniques in HCI
evaluation techniques in HCIevaluation techniques in HCI
evaluation techniques in HCIsawsan slii
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in LinuxHenry Osborne
 
Linux User Management
Linux User ManagementLinux User Management
Linux User ManagementGaurav Mishra
 
Human Computer Interaction Unit III Part 2
Human Computer Interaction Unit III Part 2Human Computer Interaction Unit III Part 2
Human Computer Interaction Unit III Part 2ashodhiyavipin
 
Computer hardware presentation
Computer hardware presentationComputer hardware presentation
Computer hardware presentationJisu Dasgupta
 
Server client-presentation.
Server client-presentation.Server client-presentation.
Server client-presentation.Norvy Villanueva
 
hci in software development process
hci in software development processhci in software development process
hci in software development processKainat Ilyas
 
Chapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemChapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemShafaan Khaliq Bhatti
 
Os structure
Os structureOs structure
Os structureMohd Arif
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating SystemKathirvel Ayyaswamy
 
Human computer interaction -Input output channel with Scenario
Human computer interaction -Input output channel with ScenarioHuman computer interaction -Input output channel with Scenario
Human computer interaction -Input output channel with ScenarioN.Jagadish Kumar
 
Bios and cmos
Bios and cmosBios and cmos
Bios and cmosOnline
 

What's hot (20)

chapter 1 introduction to operating system
chapter 1 introduction to operating systemchapter 1 introduction to operating system
chapter 1 introduction to operating system
 
Cloud computing
Cloud computingCloud computing
Cloud computing
 
evaluation techniques in HCI
evaluation techniques in HCIevaluation techniques in HCI
evaluation techniques in HCI
 
operating system structure
operating system structureoperating system structure
operating system structure
 
Server virtualization
Server virtualizationServer virtualization
Server virtualization
 
Disk and File System Management in Linux
Disk and File System Management in LinuxDisk and File System Management in Linux
Disk and File System Management in Linux
 
Linux User Management
Linux User ManagementLinux User Management
Linux User Management
 
Multimodal Interaction
Multimodal InteractionMultimodal Interaction
Multimodal Interaction
 
Kernels and its types
Kernels and its typesKernels and its types
Kernels and its types
 
Human Computer Interaction Unit III Part 2
Human Computer Interaction Unit III Part 2Human Computer Interaction Unit III Part 2
Human Computer Interaction Unit III Part 2
 
Computer hardware presentation
Computer hardware presentationComputer hardware presentation
Computer hardware presentation
 
Presentation (sharing folder)
Presentation (sharing folder)Presentation (sharing folder)
Presentation (sharing folder)
 
Server client-presentation.
Server client-presentation.Server client-presentation.
Server client-presentation.
 
hci in software development process
hci in software development processhci in software development process
hci in software development process
 
Chapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating SystemChapter 1: Introduction to Operating System
Chapter 1: Introduction to Operating System
 
Os structure
Os structureOs structure
Os structure
 
The computer HCI
The computer HCIThe computer HCI
The computer HCI
 
CS9222 Advanced Operating System
CS9222 Advanced Operating SystemCS9222 Advanced Operating System
CS9222 Advanced Operating System
 
Human computer interaction -Input output channel with Scenario
Human computer interaction -Input output channel with ScenarioHuman computer interaction -Input output channel with Scenario
Human computer interaction -Input output channel with Scenario
 
Bios and cmos
Bios and cmosBios and cmos
Bios and cmos
 

Viewers also liked

Comparison between grub-legacy ,lilo and grub -2
Comparison between grub-legacy ,lilo and grub -2Comparison between grub-legacy ,lilo and grub -2
Comparison between grub-legacy ,lilo and grub -2iamumr
 
Linux ppt
Linux pptLinux ppt
Linux pptlincy21
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux pptOmi Vichare
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt onu9
 

Viewers also liked (6)

Apache Ppt
Apache PptApache Ppt
Apache Ppt
 
Comparison between grub-legacy ,lilo and grub -2
Comparison between grub-legacy ,lilo and grub -2Comparison between grub-legacy ,lilo and grub -2
Comparison between grub-legacy ,lilo and grub -2
 
Printing on Linux, simple right?
Printing on Linux, simple right?Printing on Linux, simple right?
Printing on Linux, simple right?
 
Linux ppt
Linux pptLinux ppt
Linux ppt
 
Introduction to linux ppt
Introduction to linux pptIntroduction to linux ppt
Introduction to linux ppt
 
Linux.ppt
Linux.ppt Linux.ppt
Linux.ppt
 

Similar to Printing with cups (linux)

Instalação em sistemas linux
Instalação em sistemas linuxInstalação em sistemas linux
Instalação em sistemas linuxScanSource Brasil
 
Unix printer driver_2ndfeb2017_final
Unix printer driver_2ndfeb2017_finalUnix printer driver_2ndfeb2017_final
Unix printer driver_2ndfeb2017_finalSangeetha Subramani
 
Printing in linux with cups
Printing in linux with cupsPrinting in linux with cups
Printing in linux with cupsMuqthiyar Pasha
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-adminbadamisri
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-adminbadamisri
 
Chapter08 Implementing And Managing Printers
Chapter08      Implementing And  Managing  PrintersChapter08      Implementing And  Managing  Printers
Chapter08 Implementing And Managing PrintersRaja Waseem Akhtar
 
Network Implementation and Support Lesson 08 Printers - Eric Vanderburg
Network Implementation and Support Lesson 08   Printers - Eric VanderburgNetwork Implementation and Support Lesson 08   Printers - Eric Vanderburg
Network Implementation and Support Lesson 08 Printers - Eric VanderburgEric Vanderburg
 
Comp10080 Os L12
Comp10080  Os L12Comp10080  Os L12
Comp10080 Os L12gueste5b156
 
Ubuntu getting started
Ubuntu getting startedUbuntu getting started
Ubuntu getting startedErnesto Celis
 
ANSWERFundamental configurations of Windows printer Deployments.pdf
ANSWERFundamental configurations of Windows printer Deployments.pdfANSWERFundamental configurations of Windows printer Deployments.pdf
ANSWERFundamental configurations of Windows printer Deployments.pdfaplolomedicalstoremr
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsManuel Vega
 

Similar to Printing with cups (linux) (20)

Instalação em sistemas linux
Instalação em sistemas linuxInstalação em sistemas linux
Instalação em sistemas linux
 
Unix printer driver_2ndfeb2017_final
Unix printer driver_2ndfeb2017_finalUnix printer driver_2ndfeb2017_final
Unix printer driver_2ndfeb2017_final
 
Printing in linux with cups
Printing in linux with cupsPrinting in linux with cups
Printing in linux with cups
 
Print server
Print serverPrint server
Print server
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 
Linux Conf Admin
Linux Conf AdminLinux Conf Admin
Linux Conf Admin
 
Linux conf-admin
Linux conf-adminLinux conf-admin
Linux conf-admin
 
Ch14 system administration
Ch14 system administration Ch14 system administration
Ch14 system administration
 
Tutorial
TutorialTutorial
Tutorial
 
Tutorial
TutorialTutorial
Tutorial
 
Rhhpc Installation Guide 20100524
Rhhpc Installation Guide 20100524Rhhpc Installation Guide 20100524
Rhhpc Installation Guide 20100524
 
Chapter08 Implementing And Managing Printers
Chapter08      Implementing And  Managing  PrintersChapter08      Implementing And  Managing  Printers
Chapter08 Implementing And Managing Printers
 
Network Implementation and Support Lesson 08 Printers - Eric Vanderburg
Network Implementation and Support Lesson 08   Printers - Eric VanderburgNetwork Implementation and Support Lesson 08   Printers - Eric Vanderburg
Network Implementation and Support Lesson 08 Printers - Eric Vanderburg
 
Linux
LinuxLinux
Linux
 
Comp10080 Os L12
Comp10080  Os L12Comp10080  Os L12
Comp10080 Os L12
 
Ubuntu getting started
Ubuntu getting startedUbuntu getting started
Ubuntu getting started
 
ANSWERFundamental configurations of Windows printer Deployments.pdf
ANSWERFundamental configurations of Windows printer Deployments.pdfANSWERFundamental configurations of Windows printer Deployments.pdf
ANSWERFundamental configurations of Windows printer Deployments.pdf
 
95039099
9503909995039099
95039099
 
Install websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bitsInstall websphere message broker 8 RHEL 6 64 bits
Install websphere message broker 8 RHEL 6 64 bits
 
Presentation operation system
Presentation operation systemPresentation operation system
Presentation operation system
 

More from Raghu nath

Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)Raghu nath
 
Javascript part1
Javascript part1Javascript part1
Javascript part1Raghu nath
 
Regular expressions
Regular expressionsRegular expressions
Regular expressionsRaghu nath
 
Selection sort
Selection sortSelection sort
Selection sortRaghu nath
 
Binary search
Binary search Binary search
Binary search Raghu nath
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)Raghu nath
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithmsRaghu nath
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp roleRaghu nath
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4Raghu nath
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3Raghu nath
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2Raghu nath
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1Raghu nath
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2Raghu nath
 
python chapter 1
python chapter 1python chapter 1
python chapter 1Raghu nath
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell ScriptingRaghu nath
 

More from Raghu nath (20)

Mongo db
Mongo dbMongo db
Mongo db
 
Ftp (file transfer protocol)
Ftp (file transfer protocol)Ftp (file transfer protocol)
Ftp (file transfer protocol)
 
MS WORD 2013
MS WORD 2013MS WORD 2013
MS WORD 2013
 
Msword
MswordMsword
Msword
 
Ms word
Ms wordMs word
Ms word
 
Javascript part1
Javascript part1Javascript part1
Javascript part1
 
Regular expressions
Regular expressionsRegular expressions
Regular expressions
 
Selection sort
Selection sortSelection sort
Selection sort
 
Binary search
Binary search Binary search
Binary search
 
JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)JSON(JavaScript Object Notation)
JSON(JavaScript Object Notation)
 
Stemming algorithms
Stemming algorithmsStemming algorithms
Stemming algorithms
 
Step by step guide to install dhcp role
Step by step guide to install dhcp roleStep by step guide to install dhcp role
Step by step guide to install dhcp role
 
Network essentials chapter 4
Network essentials  chapter 4Network essentials  chapter 4
Network essentials chapter 4
 
Network essentials chapter 3
Network essentials  chapter 3Network essentials  chapter 3
Network essentials chapter 3
 
Network essentials chapter 2
Network essentials  chapter 2Network essentials  chapter 2
Network essentials chapter 2
 
Network essentials - chapter 1
Network essentials - chapter 1Network essentials - chapter 1
Network essentials - chapter 1
 
Python chapter 2
Python chapter 2Python chapter 2
Python chapter 2
 
python chapter 1
python chapter 1python chapter 1
python chapter 1
 
Linux Shell Scripting
Linux Shell ScriptingLinux Shell Scripting
Linux Shell Scripting
 
Perl
PerlPerl
Perl
 

Recently uploaded

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxheathfieldcps1
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docxPoojaSen20
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfsanyamsingh5019
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introductionMaksud Ahmed
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfUmakantAnnand
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfakmcokerachita
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationnomboosow
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdfssuser54595a
 

Recently uploaded (20)

The basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptxThe basics of sentences session 2pptx copy.pptx
The basics of sentences session 2pptx copy.pptx
 
MENTAL STATUS EXAMINATION format.docx
MENTAL     STATUS EXAMINATION format.docxMENTAL     STATUS EXAMINATION format.docx
MENTAL STATUS EXAMINATION format.docx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Sanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdfSanyam Choudhary Chemistry practical.pdf
Sanyam Choudhary Chemistry practical.pdf
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
microwave assisted reaction. General introduction
microwave assisted reaction. General introductionmicrowave assisted reaction. General introduction
microwave assisted reaction. General introduction
 
Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1Código Creativo y Arte de Software | Unidad 1
Código Creativo y Arte de Software | Unidad 1
 
Staff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSDStaff of Color (SOC) Retention Efforts DDSD
Staff of Color (SOC) Retention Efforts DDSD
 
Concept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.CompdfConcept of Vouching. B.Com(Hons) /B.Compdf
Concept of Vouching. B.Com(Hons) /B.Compdf
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Class 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdfClass 11 Legal Studies Ch-1 Concept of State .pdf
Class 11 Legal Studies Ch-1 Concept of State .pdf
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 
Interactive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communicationInteractive Powerpoint_How to Master effective communication
Interactive Powerpoint_How to Master effective communication
 
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
18-04-UA_REPORT_MEDIALITERAСY_INDEX-DM_23-1-final-eng.pdf
 

Printing with cups (linux)

  • 1. Printing with CUPS CUPS (COMMON UNIX PRINTING SYSTEM)
  • 2. A printing system handles the tasks involved in getting a print job from an application (or the command line) through the appropriate filters LPD and LPR Traditionally, UNIX had two printing systems: the BSD Line Printer Daemon (LPD) and the System V Line Printer system (LPR). Linux adopted these systems at first, and both UNIX and Linux have seen modifications to and replacements for these systems. Today CUPS is the default printing system under Fedora/RHEL.
  • 3. 1. CUPS CUPS (Common UNIX Printing System) is a cross-platform print server built around IPP (next). 2. CUPS provides many printer drivers and can print different types of files, including PostScript. 3. Because it is built on IPP and written to be portable, CUPS runs under many operating systems, including Linux and Windows. Other UNIX variants, including Mac OS X, use CUPS; recent versions of Windows include the ability to print to IPP printers. 4. Thus CUPS is an ideal solution for printing in a heterogeneous environment. 5. CUPS provides System V and BSD command-line interfaces and, in addition to IPP, supports LPD/LPR, HTTP, SMB, and JetDirect (socket) protocols, among others.
  • 4. Network printers Printers connected directly to a network are functionally equivalent to printers connected to a system running a print server: They listen on the same ports as systems running print servers, and they queue jobs. Printers and queues On a modern computing system, when you “send a job to the printer,” you actually add the job to the list of jobs waiting their turn to be printed on a printer. This list is called a print queue or simply a queue. The phrase configuring (or setting up) a printer is often used to mean configuring a (print) queue. This chapter uses these phrases interchangeably.
  • 5. Prerequisites: Make sure the following packages are installed (most are installed with the base Fedora/RHEL system): • cups • system-config-printer (optional) • cups-pdf (optional; Fedora only; sets up a virtual PDF printer)
  • 6. The CUPS Web interface requires an X server and a Web browser. Although it is a poor solution, a text Web browser such as elinks (elinks package) will work too. cups init script Run chkconfig to cause CUPS (the cupsd daemon) to start when the system goes into multiuser mode: # chkconfig cups on Start CUPS: # service cups start
  • 7. Firewall A CUPS server normally uses TCP port 631 for an IPP connection and port 80 for an LPR/LPD connection. If the CUPS server system accepts print jobs from remote systems and is running a firewall, you need to open one or both of these ports. PDF printer You can set up a virtual PDF printer by installing the cups-pdf package, or you can set up this printer manually.
  • 8. Configuring a Printer Using system-config- printer Main menu: System Administration Printing (RHEL) or give the command systemconfig-printer from a terminal emulator or Run Application window (ALT-F2).
  • 9.
  • 10. Default printer Highlight a printer in the Printing window and select menubar: Printer Set as Default from the window menu to specify the highlighted printer as the default printer. If just one printer appears in the Printing window, it is the default printer; you do not have to set it up as such. Server Settings Select menubar: Server Settings from the Printing window to display the Server Settings window. The top two check boxes in this window specify whether systemconfig- printer displays printers that are shared by other systems and whether the local system publishes printers it shares. You control whether a specific printer is shared from the Policies selection of the Printer Properties window (next).
  • 11. Configuration Selections Select menubar: Printer Properties to display the Printer Properties window This section describes the six selections found in the frame at the left side of the Printer Properties window. These selections allow you to configure the printer you chose in the Printing window
  • 12. The text boxes labeled Description and Location hold information that can help users identify The printer. The system does not use this information; change it as you like. For example, it might be helpful to put the physical location of the printer, such as Sam’s Office, in the text box labeled Location. The text boxes labeled Device URI and Make and Model specify the location of the printer on the computer or network and type of the printer.
  • 13.
  • 14. Policies The Policies selection enables you to control printer state, sharing, and banners. Under the word State are check boxes labeled Enabled, Accepting jobs, and Shared. Putting a tick in the check box labeled Shared shares the printer with other systems if the local system publishes shared printers (see “Server Settings”). The Policies tab also controls whether the printer prints banners before and after jobs and what CUPS does when the printer reports an error.
  • 15. Access Control The Access Control selection enables you to set the policy for printer access. By default, anyone can use the printer. To restrict access, you can create a blacklist of users who are not allowed to use it. Alternatively, you can prohibit anyone from using the printer and then create a whitelist of users who are allowed to use it. Printer Options The Printer Options selection controls image quality, paper size and source (tray), and other generic printer options.
  • 16.
  • 17. Setting Up a Local or Remote Printer This section describes how to set up three types of printers for local use: a printer attached to the local system, a printer hosted by another system, and a printer that resides on the local network (a network printer). The system-config-printer utility looks for printers attached to the system or the local network. It then asks if you want to adjust the firewall so the local system can detect printers on the network (Fedora only) and displays the New Printer window
  • 18. Specifying a URI The easiest way to locate a remote printer that is not listed is to select Find Network Printer under Network Printer in the frame labeled Select Device. Then enter in the text box labeled Host the name of the host the printer is attached to (the server) or, for a network printer, the name of the printer. You can specify an IP address instead of a hostname. Click Find. If it finds a printer, system-config-printer displays the name of the printer under Network Printer and fills in information about the printer on the right side of the window.
  • 19.
  • 20. If the printer is not listed, select Other (for a local printer) or one of the selections under Network Printer (for a remote printer) from the frame labeled Select Device; system-config-printer displays appropriate text boxes on the right side of the window. All selections under Network Printer require you to specify a Host and a Queue or Port number. These values locate the printer on the network.
  • 21. To specify the queue for an LPD/LPR printer, use the form printer-name; for an IPP printer, use the form /printers/printer-name; for an HP JetDirect-compatible network printer, specify the printer-name and Port number. Replace printer-name with the name of the printer on the server. If you are unsure of the name of a printer, give the command lpstat –p on the server to display the names of all printers on that system. After selecting or specifying a printer, click the button labeled Verify (if present) to make sure the printer is accessible and then click Forward. The system-config-printer utility searches for the printer driver.
  • 22.
  • 23. At this point, the system-config-printer utility closes the New Printer window, asks if you want to print a test page, and displays the new printer in the Printing window. If you have more than one print queue and want to set up the new print queue to be the default, highlight the printer and select menubar: Printer Set As Default
  • 24. Sharing CUPS Printers Display the Server Settings window by selecting menubar: Server Settings and put a tick in the Check box labeled Publish shared printers connected to this system. Using this technique allows you to chose whether to share each printer.
  • 25. IPP facilitates remote printing. The Listen directive in the CUPS configuration file, /etc/cups/cupsd.conf, specifies which IP address and port or which domain socket path CUPS binds to and accepts requests on. The Listen directive has the following format: Listen IP:port | path
  • 26. where IP is the IP address that CUPS accepts connections on, port is the port number that CUPS listens on for connections on IP, and path is the pathname of the domain socket CUPS uses to communicate with printers. CUPS typically uses port 631 and by default binds to localhost. Thus it accepts connections from the loopback service of the local system only. CUPS uses /var/run/cups/cups.sock, a local domain socket, to communicate with local printers. It can also use a Port directive to specify the port number it listens to for HTTP requests.
  • 27. $ grep -i listen /etc/cups/cupsd.conf # Only listen for connections from the local machine. Listen localhost:631 Listen /var/run/cups/cups.sock
  • 28. To allow other systems to connect to the CUPS server on the local system, you must instruct CUPS to bind to an IP address that the other systems can reach. First remove or comment out the Listen localhost:631 directive; leave the other Listen directive in place: # Listen localhost:631 Listen /var/run/cups/cups.sock In place of the commented-out Listen directive, use an access control list to permit only selected machines to connect to local printers. An access control list is
  • 29. defined inside a <Location> container (see page 934 for the Apache equivalent). The following example allows only the system at IP address 192.168.1.101 and the local system to print to the specified printer. <Location /> Order Allow,Deny # Allow access from the local system and 192.168.1.101 Allow from localhost Allow from 192.168.1.101 # Uncomment the following line to permit access from all systems # Allow @LOCAL </Location> The @LOCAL macro is internal to CUPS and specifies the local system. This macro accepts communication from any address that resolves to the local system. Specify Allow @LOCAL to share the printer with all systems.
  • 30. Print from Windows Print Using CUPS Modern versions of Windows (2000 and later) support IPP and as a result can communicate directly with CUPS. To use this feature, you must have CUPS configured on the Linux print server to allow remote IPP printing; you also need to create a new printer on the Windows system that points to the IP address of the Linux print server First set up the /etc/cups/cupsd.conf file to allow network printing from a client, as explained in “Sharing CUPS Printers”
  • 31. Windows XP From Windows XP, go to Control Panel􀁄Printers and Faxes and click Add Printer. Click Next in the introductory window and select A network printer or a printer attached to another computer. Click Next. Select Connect to a printer on the Internet or on a home or office network. Continue following the next paragraph at “Enter URL.”
  • 32. Windows 7 From Windows 7, go to Control Panel􀁄Devices and Printers and click Add a printer. Click Add a network, wireless, or Bluetooth printer. Assuming Windows does not find the printer, click The printer that I want isn’t listed. Click the radio button labeled Select a shared printer by name.
  • 33. Enter URL Enter the following information in the text box (under Windows XP it is labeled URL): http://hostname:631/printers/printer-name where hostname is the name or IP address of the Linux CUPS server system and printer-name is the name of the printer on that system. For example, for the printer named dog88 on the system named dog at IP address 192.168.0.12, you could enter http://dog:631/printers/dog88 or http://192.168.0.12:631/printers/dog88. If you use a hostname, it must be defined in the hosts file on the Windows machine. Click Next. Windows requests that you specify the manufacturer and model of printer or provide a driver for the printer. If you supply a printer driver, use the Windows version of the driver.
  • 34. Print Using Samba Samba must be set up so that the Windows user who will be printing is mapped to a Linux user (including mapping the Windows guest user to the Linux user nobody). Windows supports printer sharing via SMB, which allows a printer to be shared transparently between Windows systems using the same mechanism as file sharing. Samba allows Windows users to use printers connected to Linux systems just as they would use any other shared printers
  • 35. When you use rpm to install Samba, it creates a directory named /var/spool/samba that is owned by the root account and that anyone can read from and write to $ ls -ld /var/spool/samba drwxrwxrwt. 2 root root 4096 02-03 15:23 /var/spool/samba
  • 36. Under Fedora, put the following two lines in the [global] section of the /etc/samba/smb.conf file. Under RHEL, these lines are set up by default, you need only change the printcap name as shown. [global] ... printing = cups printcap name = cups
  • 37. The printer’s share is listed in the [printers] section in smb.conf. In the following example, the path is the path Samba uses as a spool directory and is not a normal share path. The settings allow anyone, including guest, to use the printer. The [printers] section in the default smb.conf file has the following entries, which are appropriate for most setups:
  • 38. [printers] comment = All Printers path = /var/spool/samba browseable = no guest ok = no writable = no printable = yes
  • 39. Printing to Windows CUPS views a printer on a Windows machine exactly the same way it views any other printer. The only difference is the URI you need to specify when connecting it. To configure a printer connected to a Windows machine, click the Administration tab in the CUPS Web interface and select Add Printer, just as you would for a local printer.
  • 40. When you are asked to select the device, choose Windows Printer via SAMBA. Enter the URI of the printer in the following format: smb://windows_system/printer_name where windows_system can be an IP address or a hostname. After you have added the printer, you can use it as you would any other printer.