You are not logged in.

#1 2008-12-05 16:39:02

sokuban
Member
Registered: 2006-11-11
Posts: 412

[SOLVED]Linux to Linux printer sharing

I'm trying to get Linux to Linux printer sharing to work. The printserver runs slackware 12.1 and the client runs Archlinux. The printer is a parallel port printer that works perfectly locally.

This is the cupsd.conf on the printserver:

LogLevel info

SystemGroup sys root

Listen localhost:631
Listen 192.168.0.106:631
Listen /var/run/cups/cups.sock

Browsing On
BrowseOrder allow,deny
BrowseAllow all
BrowseAddress @LOCAL

DefaultAuthType Basic

<Location />
  Order allow,deny
  Deny From All
  Allow From 127.0.0.1
  Allow From 192.168.0.*
</Location>

<Location /admin>
  Encryption Required
  Order allow,deny
</Location>

<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
</Location>

<Policy default>
  <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>

  <Limit CUPS-Add-Modify-Printer CUPS-Delete-Printer CUPS-Add-Modify-Class CUPS-Delete-Class CUPS-Set-Default>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  <Limit Pause-Printer Resume-Printer 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-Accept-Jobs CUPS-Reject-Jobs>
    AuthType Default
    Require user @SYSTEM
    Order deny,allow
  </Limit>

  <Limit Cancel-Job CUPS-Authenticate-Job>
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

  <Limit All>
    Order deny,allow
  </Limit>
</Policy>

This is the client.conf on the client:

ServerName 192.168.0.106

Browsing On
BrowseOrder allow,deny
BrowseAllow all

I've been reading around the Arch and gentoo wikis, and from my understanding of it, I should be able to open a browser on the client computer and enter in 192.168.0.106:631 (the printserver) and be presented with the printserver's page. However this gives me a 403 Forbidden error.

However I tried adding the printer from the client anyways. I used Internet Printing Protocol (http) and put the URI as http://192.168.0.106:631/printers/Ami (That was the URL I got by clicking the printer on the server, although it said localhost instead of 192.168.0.106) Not surprisingly, this didn't work.

Last edited by sokuban (2008-12-07 02:37:27)

Offline

#2 2008-12-05 17:13:58

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]Linux to Linux printer sharing

Network ate my post!11

In short: add Allow From your_desktop_ip to those two other admin sections if you want to browse/change settings of cups on the server from your desktop; default cupsd.conf should work on your desktop, that URI is indeed the way to do this - try changing http to ipp and make sure the firewall isn't interfering.

Offline

#3 2008-12-05 19:47:55

sokuban
Member
Registered: 2006-11-11
Posts: 412

Re: [SOLVED]Linux to Linux printer sharing

I don't really want to access the admin stuff with a different computer. If it is normal to get a 403 Forbidden when trying to go to printserver:631 I'll just leave it at that. However I should note that even on the printserver I can only access it with localhost:631 and not 192.168.0.106:631 which leads me to believe that even adding the allow line to the other computer's IP will have no effect.

I tried ipp as well, but that didn't work. I don't have any firewall. (Just a router) I'm not sure if that would interfere with anything.

Last edited by sokuban (2008-12-05 19:48:21)

Offline

#4 2008-12-05 21:03:46

Zariel
Member
Registered: 2008-10-07
Posts: 446

Re: [SOLVED]Linux to Linux printer sharing

is it allowed in hosts?

Offline

#5 2008-12-05 21:54:07

sokuban
Member
Registered: 2006-11-11
Posts: 412

Re: [SOLVED]Linux to Linux printer sharing

Zariel wrote:

is it allowed in hosts?

Is this required?

I put a line in hosts.allow for my "client's_IP_address hostname.localdomain hostname" (The way I have it in hosts except not 127.0.0.1) but that didn't seem to make any difference. So I tried and put the same line in hosts. This didn't do anything either.

Offline

#6 2008-12-05 22:17:22

lucke
Member
From: Poland
Registered: 2004-11-30
Posts: 4,018

Re: [SOLVED]Linux to Linux printer sharing

Put "ALL: 192.168.0.x: ALLOW' (your client's ip) in /etc/hosts.allow. If it doesn't work, check the logs in /var/log/cups/ for clues.

Offline

#7 2008-12-05 22:33:22

shazeal
Member
From: New Zealand
Registered: 2007-06-05
Posts: 341

Re: [SOLVED]Linux to Linux printer sharing

I had the same issue the other day, I had to give the client computer admin rights, then in the cups printer page on the client I had to publish the printer. Not sure if its quite the same thing, I was able to see the printer on the client but it would not print anything.

Offline

#8 2008-12-06 01:09:31

sokuban
Member
Registered: 2006-11-11
Posts: 412

Re: [SOLVED]Linux to Linux printer sharing

If I add that line in hosts.allow and add Allow From 192.168.0.105 in every single part of the server's cupsd.conf, I can see the printer by going to the printer's tab in the client's localhost without doing anything. It looks promising because not only does it show, but the picture is green and not red, and there isn't some error about foomatics.

The printer shows now, but even after all those Allow From lines, I still get a 403 Forbidden if I go to 192.168.0.106:631 on /either computer/.

Description: HP LaserJet 4P
Location: Woodstone
Printer Driver: HP LaserJet 4P Foomatic/hpijs (recommended) on Chester.localdomain
Printer State: idle, accepting jobs, not published.
Device URI: ipp://Chester.localdomain:631/printers/Ami

However I can't do anything with it. If I try to print a test page or publish the printer, I get a chester.localdomain (the printserver's hostname) cannot be found error. Notice it is a not found error. I tried putting in 192.168.0.106 in a web browser and it gave me a different error than chester.localdomain so it lead me to believe that my computer doesn't know what chester.localdomain is. Maybe I could edit that in to my hosts on the client later.

After that I copied the publish printer URL and instead of putting "http://chester.localdomain:631/admin/?o … i&shared=1", I put "http://192.168.0.106:631/admin/?op=set- … i&shared=1". The first time I did this Firefox gave me all these errors about false security certificates, I said to make an exception (but not to save it) and after a couple of those pages I got another page to load that resembled the CUPS admin but didn't have any pictures. It asked for my root password (I put it >_<), then it said something like "printer published successfully" or something. But a second after that the page reloaded to a 403 error. If I went back to localhost:631 on the client and went to the printer tab I could see that the printer was unpublished (or so I think, because there is still a publish printer button, and for the record if I go to localhost:631 on the server the printer is unpublished, because I see an unpublish printer button). So essentially it didn't do much. If I try again Firefox doesn't tell me about the security certificate (I don't know why, I chose to not save it), but I either get 403 Forbidden immediately or a second after I see some of the CUPS admin text loaded. EDIT: It tells me about the security certificates again if I restart Firefox, and I think sometimes I might be able to load the printer was published successfully thing again.

It smells like a firewall is in the way. Which makes little sense because I don't have a firewall. Unless routers get in the way.

EDIT: I added Chester to my hosts on the client. This didn't change much. Now I can go through the above scenario with a click rather than copying the link and changing the chester.localdomain to 192.168.0.106 I guess it might help in the future if I ever get this to work.

Last edited by sokuban (2008-12-06 01:17:28)

Offline

#9 2008-12-06 08:37:22

shazeal
Member
From: New Zealand
Registered: 2007-06-05
Posts: 341

Re: [SOLVED]Linux to Linux printer sharing

Try this instead, should work, should have looked closer the first time.

Edit: and i should double check... forgot to add localhost.

<Location /admin>
  #Encryption Required
  Order allow,deny
  Allow localhost
  Allow @LOCAL
</Location>

<Location /admin/conf>
  AuthType Basic
  Require user @SYSTEM
  Order allow,deny
  Allow localhost
  Allow @LOCAL
</Location>

Last edited by shazeal (2008-12-06 08:38:58)

Offline

#10 2008-12-06 15:06:21

sokuban
Member
Registered: 2006-11-11
Posts: 412

Re: [SOLVED]Linux to Linux printer sharing

I tried that and I have the same problem. I commented out my Allow From 192.168.0.105 lines in those two sections, but left it in all the other sections that I put it.

Offline

#11 2008-12-06 20:55:58

shazeal
Member
From: New Zealand
Registered: 2007-06-05
Posts: 341

Re: [SOLVED]Linux to Linux printer sharing

<Location />
  Order allow,deny
  Allow localhost
  Allow @LOCAL
</Location>

Try this in addition to the above then, Im not quite sure how you got your initial config its very... odd smile

Offline

#12 2008-12-07 02:32:38

sokuban
Member
Registered: 2006-11-11
Posts: 412

Re: [SOLVED]Linux to Linux printer sharing

When I went to my config to try to put in the above, I noticed it was in a mess. I have no clue how it got to be in that mess and I am sure I didn't put it that way, but it was in a mess. I can only guess that it was because I fiddled with the checkboxes on the cups web page. (I didn't know that the checkboxes had to do with the config file.)

Anyways. If I check every single check box, then it works.

On windows I can add the printer through cups fine (where you manually type the url http://192.168.0.106:631/printers/Ami). I do not have any sort of samba set up, so I am sure that it is working through cups.

However the odd thing is that it only works on my computer, and not my sister's. Both computers run windows. I have no clue why, but I have a feeling it has to do with the fact that I set sokuban (my login name for all of my computers in all OSes) to be an allowed user in the web page. My sister can add the printer, but she cannot print anything. This is very odd because windows, unlike Linux doesn't add printers that it doesn't find. (At the very beggining I tried this on my windows computer and I got an error when I typed the url and pushed next.)

Also it doesn't work on Linux with my computer. I'm going to assume it is a driver problem. Since it gave me errors about foomatic, I went and pacman -S 'd every single thing in the pacman database with the word foomatic on it. Now I was getting a different error but still about foomatic: "/usr/lib/cups/filter/foomatic-rip".

EDIT: That was it, that was the problem. I took out the whole set allowed users thing, just left it blank and now it works fine on Linux and my sister's computer. The odd thing is that the working URI is /dev/null. I don't know much about /dev/null other than the jokes, and the jokes led me to believe having a printer URI as /dev/null is a bad thing, but it works so... yeah. Page from openoffice also printed fine.

Last edited by sokuban (2008-12-07 02:36:58)

Offline

Board footer

Powered by FluxBB