cis 191 - lesson 10 printers. cis 191 - lesson 10

69
CIS 191 - Lesson 10 Printers

Upload: jody-lawrence

Post on 16-Jan-2016

273 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Printers

Page 2: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Page 3: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Two predominate types of printers• Thermal inkjet technology• Laser, drum, toner technology

Page 4: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

So many ways to hook them up …

Now:• Network• USB• Wireless (Bluetooth, IR)• PictBridge (USB based)

Back then:• Serial cable• Parallel printer cable

Page 5: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

PrinterConfiguration

Page 6: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

System V based print subsystem• lp (to print)• lpstat (queue management)• cancel (to remove jobs)

BSD based print subsystem• lpr (to print)• lpq (queue management)• lprm (to remove jobs)

CUPS• Provides both System V and Berkeley based command-line interfaces• Supports new Internet Printing Protocol• Works with Samba

Printing

We will be just looking at CUPS

Page 7: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

The service command will check the status and start

up the service.

CUPS has a web based administration tool which can

be reached on port 631.

Page 8: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

ServiceConfiguration

Page 9: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Sidetrack – Service command

Not: the effects of the service command changes will last until the next shutdown .

They are not permanent.

Page 10: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Use the type and file

commands to find

the location and type

of commands

Sidetrack – Service command

The service command is a viewable shell script

(reduced type size here so it will fit)

Page 11: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

CUPS is managed by a web-based configuration utility on port 631

Local access only by default

Page 12: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

To enable remote access click on Administration tab …

Page 13: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

… and scroll down to allow remote administration

Page 14: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Authenticate yourself as root to confirm change to allow remote administration

CUPS service will restart

Page 15: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSBrowse to http://xxx.xxx.xxx.xxx:631/ from another system

You may now manage the CUPS service on Benji remotely from another system.

Page 16: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Printer: HP LaserJet 1320nConnection: LAN

Next step is to add printers

Page 17: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

IP Address for this 1320n is 192.168.0.12

The LaserJets also have a web-based management utility

Page 18: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

benji192.168.0.25

hp1320n192.168.0.12

This example will show how to add the HP 1320n as a networked printer.

Page 19: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

To add in HP 1320N printer …

… the first step is to click the Add Printer button

Page 20: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

You may get this error if your are browsing in remotely because no certificates have been set up for https protocol.

Not a problem if you are browsing locally

Page 21: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

One way to address the certificate problem is to add an exception.

Page 22: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

This adds the exception

Page 23: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Add an exception only when you do trust the site. In this case we built and setup the Benji VM so we trust it.

Page 24: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Click Confirm Security Exception button

Page 25: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Now we can add the LaserJet

Page 26: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Fill in basic information

Page 27: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

We will use JetDirect.

JetDirect is a small printer server built into some of HP's printers.

Page 28: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Hmmm …. lets click on Network Printers link to figure this one out.

Page 29: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Scroll down to HP printers

Page 30: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

We will use the JetDirect w/o IPP for the HP 1320n

IPP is Internet Printing Protocol for send print jobs over the Internet via the http protocol

HP JetDirect cards use port 9100

A socket is the combination of an IP address and a port number.

Page 31: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

socket://192.168.0.12/9100

This defines how to communicate with the printer

Page 32: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

(you will need to enter root's password)

Service will restart

Page 33: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Must select printer from long list

Page 34: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

We will choose hp LaserJet 1320 series Postscript (recommended) (en)

Page 35: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Lets double check the printer supports PostScript … it does

Page 36: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

To finally add the printer it will be necessary authenticate as root

Page 37: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Printer has been added

Page 38: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

View of newly added printer from Printer tab

Page 39: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Lets test the printer by printing this CUPS web page to it … and it works.

Page 40: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Printer: hp photosmart 7550 (color inkjet technology)Connection: USB

Lets add second printer

Page 41: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Sidetrack – The previous 7550 "Hot Lips"

6 G's of acceleration8-pen turret

Grit wheel technology from HP Labs

Page 42: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

benji192.168.0.25

hpdv2000192.168.0.27

The second printer is connected by USB to a Windows notebook computer

Page 43: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

First step is the same which is to fill out basic information on printer

Page 44: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

For this connection we will use Samba. Samba implements Windows file and print services sharing on Linux.

Note Windows uses SMB (Server Message Block) protocol to implement these services

Page 45: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Will need to specify the Windows print share

Page 46: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSWill need to specify the Windows print share as //hostname/printsharename

Page 47: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Username and password Not requiredThis machine is in the same workgroup

smb://server/sharename

This machine is in a different workgroup

smb://workgroup/server/sharename

Username and password requiredThis machine is in the same workgroup smb://username:password@server/sharename

This machine is in a different workgroup

smb://username:password@workgroup/server/sharename

Ways to specify a Windows share

Page 48: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Select make of printer

Page 49: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Select model of printer

HP PhotoSmart 7550 Foomatic/hpijs (recommended) (en)

Page 50: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Printer has been added

Page 51: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPS

Test new printer by printing its own management page

Page 52: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Printingin Linux

Page 53: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSlpstat command

The –p option will show the available printers The –d option will identify the default printer

Page 54: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSlp and lpr commands

Either command will print myfile to the selected printer

Note that both lp and lpr will read from stdin.

This allows output from another command to be piped in

Page 55: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSconvert command

JPEG files need to be converted to postscript before printing with lp or lpr commands

Print job #28

Page 56: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

ConfiguringCUPS

Page 57: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSconfiguration file or command, or GUI

Must restart CUPS after changing configuration file with:service cups restart

Three ways to set the default printer – edit configuration file, command or GUI

[root@benji ~]# cat /etc/cups/printers.conf# Printer configuration file for CUPS v1.2.4# Written by cupsd on 2008-11-16 03:06<DefaultPrinter hp7550>Info hp photosmart 7550Location DenDeviceURI smb://hpdv2000/hp7550State IdleStateTime 1226791825Accepting YesShared YesJobSheets none noneQuotaPeriod 0PageLimit 0KLimit 0OpPolicy defaultErrorPolicy stop-printer

</Printer>

Page 58: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSlpoptions command

The –d option will set the default printer. This will override the system default printer set using the web UI

Page 59: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

ManagingPrintJobs

Page 60: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSRejecting Jobs

Clicking the button on the web based utility will reject further jobs

Page 61: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSStopping the Printer

Clicking the button on the web based utility will still allow jobs to be spooled

Page 62: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSShowing jobs waiting to print

Use lpq or lpstat to show spooled print jobs

Page 63: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSRemoving/canceling pending print jobs

Use lpq or lpstat to show the spooled print jobs

Use cancel or lprm to remove print jobs

Page 64: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Spool Files

Page 65: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSSpool files in /var/spool/cups

Spooled print files are kept in pairs – one control file and one data file – in /var/spool/cups

Print job #27

Page 66: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

CUPSSpool files in /var/spool/cups

The data file is ascii and the control file is binary when printing a text file

Print job #27

Page 67: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Exercise: CUPS

• Enable the CUPS service to run at system startup

• Turn on the CUPS service

• Create a "fake" printer and disable it.

• Practice printing to your fake printer.

Page 68: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

wrap up

Page 69: CIS 191 - Lesson 10 Printers. CIS 191 - Lesson 10

CIS 191 - Lesson 10

Commands:service - Manually control serviceschkconfig - Service startup configurationifconfig - Getting IP address

lp, lpr - Linux print commandcancel, lprm - cancel print joblpq, lpstat - Show print queuelpoptions - Show and change print optionsconvert - convert image file types

Files and Directories:/var/spool/cups - spooled print jobs/etc/cups - CUPS configuration files

Web:http://hostname:631 - CUPS web based management utilityhttp://hostname:9100 - HP JetDirect printer