Connect printer



Links: 

There's two ways to print from a self-administrated Linux computer; with the SMB-protocol or with the IPP-protocol.

The benefit of using IPP is that all printers are installed at once and you don't need to download a PPD-file. The drawback is

that it doesn't work with all versions of CUPS due to problems with the CUPS authentication mechanism and kerberos implementation.

With SMB

1. Fetch the ppd-file from http://print.chalmers.se/drivers
It should be named .ppd. Save it where you can easily
find it.
 
2. Run the command  "system-config-printer" from a terminal window.
Click on "Add printer" --> "Network printer" --> "Windows printer via SAMBA".
If you can not find  "Windows printer via SAMBA" in the menu you probably need to install SAMBA client software on your computer. The easiest way to do that is to use your linux distributions package manager.
Device URI: smb://print.chalmers.se/ ex:
 
3. Tick  "Set authentication details now".  If your Chalmers username/CID is 'kalle' the username here will be 'NET\kalle'.
The password is your usual Chalmers password.
 
4. Click on "Forward". Then you will see a message about "Searching
for drivers", wait  until a dialog box is shown. Choose "Provide ppd", browse to
the ppd -file you fetched.
 
5. Click on "Forward" in the dialog boxes  that comes up, make sure you give the printer
a sensible name (the same as on the print server is recommended).

With IPP

The clock on your computer must be on time. If it's more than five minutes off you cannot authenticate against the print server.

 

Configure kerberos. Here's an example of a working /etc/krb5.conf:

# $Id: krb5.conf,v 1.5 2008/05/19 09:10:15 biorn Exp $
# Detta är ett standarförslag för /etc/krb5.conf
# De som inte känner sig riktigt bekväma med att använda DNS för
# att hitta KDC:erna och de som kör nån kerberos som inte hanterar
# DNS kan avkommentera realm-definitionen och kommentera raden
# dns_lookup_kdc = true
# De som erbjuder tjänster av någon slags dignitet bör använda en
# serviceprincipal för tjänsten. Kontakta cdks-drift@ita för vidare info.
#
# Egenheter:
# - tru64 5.1 gillar inte kommentarer ('#') i krb5.conf

[libdefaults]
        default_realm = CHALMERS.SE
        clockskew = 300
        v4_instance_resolve = false
        dns_lookup_kdc = true

[realms]
#        CHALMERS.SE = {
#                kdc = kdc1.ita.chalmers.se:88
#                kdc = kdc2.ita.chalmers.se:88
#                kdc = kdc3.ita.chalmers.se:88
#        }

[domain_realm]
        .chalmers.se = CHALMERS.SE
        chalmers.se = CHALMERS.SE
[logging]
        default = SYSLOG:INFO:USER

Use the command 'klist' to check if you have a valid kerberos ticket. The command 'kinit' is used to get a new ticket:

> kinit elijah
Password for elijah@CHALMERS.SE:

 

You must set the environment variable CUPS_GSSSERVICENAME to "HTTP".

Edit configuration file for your shell (bash or tcsh) so that it is applied at logon.

Example, .bash_profile:

export CUPS_GSSSERVICENAME=HTTP

To check if it is set, you can do:
echo $CUPS_GSSSERVICENAME

With newer versions of the CUPS software you should set this in the client.conf file

instead, (see below).

 

Fix /etc/cups/client.conf (or $HOME/.cups/client.conf):

echo  "ServerName  print.chalmers.se"  >   /etc/cups/client.conf

With newer versions of CUPS you should add:

echo  "GSSServiceName    HTTP"  >>   /etc/cups/client.conf

 

When you've come this far you can check if printing works. Make sure you have

a kerberos ticket and test with lpr:


lpr   test.txt
 

If you receive a 'Uauthorized' message, it means that you have an incompatible CUPS
version installed or that you have missed to set the CUPS_GSSSERVICENAME variable.

 

Updating CUPS

 

If you can not print using the CUPS version you have installed, follow the instructions
below.
You must have at least CUPS version 1.3.8 , 1.3.9 , 1.4.4 up to ??.

1.5.0 doesn't work, maybe 1.5.2 works.
Maybe it works with CUPS 1.3.7 and some earlier 1.3 versions.
1.4 versions earlier than 1.4.4 is  not working.
1.2 doesn't work.

You can check the CUPS version you have by running the command:

cups-config   --version



Try to install a compatible version of CUPS with your distributions package manager, if there is no compatible version available you must compile CUPS yourself. Read the documentation
or google if you do not know what to do. It's usually not that difficult, often it is enough with the usual:

. /configure

make

make install

routine.

1.3.8, 1.3.9 or 1.4.4 can be downloaded here:

ftp.cups.org/pub/cups/

 
When you have a Kerberos ticket, the environment variable set, client.conf fixed and a working CUPS version installed, you should be able to print.

 

NOTE:  The information above about compatible CUPS-versions quickly gets outdated, you'll have to figure out yourself which versions work.

Publicerad: ti 02 aug 2011. Ändrad: må 24 feb 2014