Debian Etch: share a printer

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
Ive gone through 2 or 3 different tutorials trying to get a printer shared thats attached to my etch server and im stuck. Ive set up nfs, ssh, samba...all without much of a problem, but im getting nowhere with this :( i cant even access remotehost:631 (the CUPS setup web page) from a client machine.

Im not sure exactly what information is relevant, Ill post my cupsd.conf since I figure thats the best place to start:

# # # Sample configuration file for the Common UNIX Printing System (CUPS)
# scheduler. See "man cupsd.conf" for a complete description of this
# file.
#

# Log general information in error_log - change "info" to "debug" for
# troubleshooting... LogLevel warning

# Administrator user group... SystemGroup lpadmin

# Only listen for connections from the local machine.
Listen localhost:631
Listen 192.168.1.90
Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseOrder
allow,deny
BrowseAllow @LOCAL

# Default authentication type, when authentication is required...
DefaultAuthType Basic
DefaultEncryption IfRequested

# Restrict access to the server... <Location />
Order allow,deny
Allow localhost
Allow 192.168.1.*
</Location>

# Restrict access to the admin pages... <Location /admin>
# Encryption Required
Order allow,deny
Allow localhost
Allow 192.168.1.90 </Location>

# Restrict access to configuration files... <Location /admin/conf>
AuthType Basic
Require user @SYSTEM
Order allow,deny
Allow localhost
Allow 192.168.1.90 </Location>

# Set the default printer/job policies... <Policy default>
# Job-related operations must be done by the owner or an adminstrator...
<Limit Send-Document Send-URI Hold-Job Release-Job Restart-Job Purge-Jobs Set-Job-Attributes Create-Job-Subscription Renew-Subscription Cancel-Subscription Get-Notifications Reprocess-Job Cancel-Current-Job Suspend-Current-Job Resume-Job CUPS-Move-Job>
Require user @OWNER @SYSTEM
Order deny,allow </Limit>

# All administration operations require an adminstrator to authenticate...
<Limit Pause-Printer Resume-Printer Set-Printer-Attributes Enable-Printer Disable-Printer Pause-Printer-After-Current-Job Hold-New-Jobs Release-Held-New-Jobs Deactivate-Printer Activate-Printer Restart-Printer Shutdown-Printer Startup-Printer Promote-Job Schedule-Job-After CUPS-Add-Printer CUPS-Delete-Printer CUPS-Add-Class CUPS-Delete-Class CUPS-Accept-Jobs CUPS-Reject-Jobs CUPS-Set-Default>
AuthType Basic
Require user @SYSTEM
Order deny,allow </Limit>

# Only the owner or an administrator can cancel or authenticate a job...
<Limit Cancel-Job CUPS-Authenticate-Job>
Require user @OWNER @SYSTEM
Order deny,allow Allow 192.168.1.90
</Limit>
<Limit All>
Order deny,allow
</Limit>
/Policy>
#
#
#
# Printcap: the name of the printcap file.
Default is /etc/printcap.

# Leave blank to disable printcap file generation.
# Printcap /var/run/cups/printcap
#
# PrintcapFormat: the format of the printcap file, currently either
# BSD or Solaris. The default is "BSD".
#
#PrintcapFormat BSD
#PrintcapFormat Solaris
#
# PrintcapGUI: the name of the GUI options panel program to associate
# with print queues under IRIX. The default is "/usr/bin/glpoptions"
# from ESP Print Pro.
#
# This option is only used under IRIX; the options panel program
# must accept the "-d printer" and "-o options" options and write
# the selected printer options back to stdout on completion.
#
#PrintcapGUI /usr/bin/glpoptions

if the formatting is off...well, i get an error whenever i try to preview. meh.

i thought perhaps hosts.allow would need an entry for cupsd but that didnt seem to make a difference (i restarted networking after i added it)

thanks for looking :)
 

skyking

Lifer
Nov 21, 2001
22,548
5,595
146
so you can print with it locally, and have samba on the same machine?
Have you enabled printer sharing in samba?

Snippet from an smb.conf file:

# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
;[printers]
; comment = All Printers
; path = /var/spool/samba
; browseable = no
# Set public = yes to allow user 'guest account' to print
; guest ok = no
; writeable = no
; printable = yes

Uncomment what you want and place that in the smb.conf file.
Browse to the printers using samba.
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
Originally posted by: skyking
so you can print with it locally, and have samba on the same machine?
Have you enabled printer sharing in samba?

Snippet from an smb.conf file:

# NOTE: If you have a BSD-style print system there is no need to
# specifically define each individual printer
;[printers]
; comment = All Printers
; path = /var/spool/samba
; browseable = no
# Set public = yes to allow user 'guest account' to print
; guest ok = no
; writeable = no
; printable = yes

Uncomment what you want and place that in the smb.conf file.
Browse to the printers using samba.

ill give it a shot. any idea what might be keeping the CUPS page on the server from being available to my client?
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
Sharing via Samba might be simpler, especially if the clients are Windows. But if you can't connect to the IPP port then you need to figure out if it's a firewalling issue or if cupsd isn't accepting the connection.
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
well i have my laptop with ubuntu that i want to access it from, it can see a samba shared folder from the etch server, but not the printer...however the windows box i have up here *can* see the printer.

granted, the network browser on ubuntu 7.10 seems to update *very slowly*, it took a couple of minutes to find all the shares on the network to start with, meh.

so:

cant see samba shared printer from ubuntu laptop
*can* see samba shared printer from windows box

i added cupsd to hosts.allow in the following manner:

cupsd: 192.168.1.*

the same format as everything else in that file. heres a netstat:

netstat -a |grep cups
unix 2 [ ACC ] STREAM LISTENING 6806 /var/run/cups/cups.sock

it didnt show any cups entries earlier. nmap from another machine, however, doesnt show it open.

im not sure what to do now or what other information is relevant.
i have some wonderful network problem now, and whenever i

/etc/init.d/networking restart

it doesnt, and i have to reboot :-/ (being that its a headless box i dont have another option, unless someone has a suggestion)
this is a recent problem, likely unrelated (possibly from a kernel update i got the other day, not sure, meh)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
heres a netstat:

netstat -a |grep cups
unix 2 [ ACC ] STREAM LISTENING 6806 /var/run/cups/cups.sock

netstat by default doesn't show you the process name and the port name is IPP. Either grep for ipp or use lsof to see if cupsd really is listening on the network.

/etc/init.d/networking restart

it doesnt, and i have to reboot :-/ (being that its a headless box i dont have another option, unless someone has a suggestion)
this is a recent problem, likely unrelated (possibly from a kernel update i got the other day, not sure, meh)

What are you expecting it to do? It's been a while since I've looked at the initscripts on a RH-based system but IIRC that networking script doesn't do anything major like messing with interfaces, routes, etc.
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
Originally posted by: Nothinman
heres a netstat:

netstat -a |grep cups
unix 2 [ ACC ] STREAM LISTENING 6806 /var/run/cups/cups.sock

netstat by default doesn't show you the process name and the port name is IPP. Either grep for ipp or use lsof to see if cupsd really is listening on the network.

/etc/init.d/networking restart

it doesnt, and i have to reboot :-/ (being that its a headless box i dont have another option, unless someone has a suggestion)
this is a recent problem, likely unrelated (possibly from a kernel update i got the other day, not sure, meh)

What are you expecting it to do? It's been a while since I've looked at the initscripts on a RH-based system but IIRC that networking script doesn't do anything major like messing with interfaces, routes, etc.

my mistake:

netstat -a |grep ipp
tcp 0 0 localhost:ipp *:* LISTEN
udp 0 0 *:ipp *:*

i guess i should take that to mean thats its listening locally only?

when i restart networking (and Im running debian etch, as per the thread title, not RH so im not sure where the misunderstanding happened) its because the tutorials ive read (im noobish here) suggest

/etc/init.d/networking restart

as a step after doing a number of other things (tutorial on setting up NFS, CUPS, LPR). so i did *shrug* and it worked fine at the time. *this time* i was wishing to change the static IP on the box [ive reworked my ip scheme], and such a restart should drop the interface and bring it back up without a problem (and with the new address, since i had edited /etc/networking/interfaces)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
i guess i should take that to mean thats its listening locally only?

Yes, I believe the UDP port is only for the browsing portion.

when i restart networking (and Im running debian etch, as per the thread title, not RH so im not sure where the misunderstanding happened) its because the tutorials ive read (im noobish here) suggest

Yea sorry, I got confused. Generally I just ifdown/ifup a single interface if I'm working on one.

as a step after doing a number of other things (tutorial on setting up NFS, CUPS, LPR). so i did *shrug* and it worked fine at the time. *this time* i was wishing to change the static IP on the box [ive reworked my ip scheme], and such a restart should drop the interface and bring it back up without a problem (and with the new address, since i had edited /etc/networking/interfaces)

Doing it after setting up a service isn't necessary, it won't break anything but it won't really help anything either. But yea it should restart the interfaces.
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
ok were back on the same page then

any other suggestions for what i might need to do? i could, i guess, just share it through the windows box (theyre practically next to each other) but i dont learn much doing it that way (then again, since it doesnt work, i havent learned *that* much yet)
 

Nothinman

Elite Member
Sep 14, 2001
30,672
0
0
I thought Listen statements were cumulative but maybe not, try removing the second one and changing the first to "Listen *:631"
 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
Originally posted by: Nothinman
I thought Listen statements were cumulative but maybe not, try removing the second one and changing the first to "Listen *:631"

yeah... i dont really know how to do that im afraid :-/

 

xSauronx

Lifer
Jul 14, 2000
19,582
4
81
Originally posted by: Nothinman
You don't know how to edit the file?

you mean the cupsd.config i guess?

d'oh :)

that did it. thank you :)

Ill try changing some of the more specific Allow sets to * and see if my local CUPS will pick it up, but now I can access the admin page remotely