How to share a printer Linux to Linux

Hi,
I’ve seen lots of posts on sharing printers in a mixed network, but I have 3 machines all with SUSE 10.3 - and I am having great difficulty in figuring out how to share the printer attached to the machine I use as a server.

I have even tried Samba, but no success.

Has anyone succeeded with setting up a shared printer using YAST?

thanks for any reply

I just solved your problem yesterday. I’m printing using cups and IPP. So I didn’t print via samba.

You should be able to configure everything in Yast and the cups webinterface. I’ll assume that your printer is correctly configured on your server and that you are able to print there.

On server:

  1. Yast -> Security -> firewall -> allowed services -> you should allow IPP Server sevice.
  2. Yast -> Hardware -> printers -> cups server settings
    “Browse Addresses” and “root access settings” should allow @LOCAL
  3. [don’t know if this step is necessary] goto http://localhost:631/admin -> select Share published printers connected to this system

Client:

  1. !!! Yast -> Security -> firewall -> allowed services -> you should allow IPP Client sevice.
  2. Yast → Hardware → printers → add printer.
    Network… IPP … you should be able to listen for IPP broadcasts and as such detect your server. Fill in the correct printer queue name and your done

thanks for your help. It still took a few hours of trying. I eventually succeeded by making a class in CUPS on the server. This was then found by the client.

I am surprised it is still so difficult to set up a Linux only network. I am running a small office, & want to avoid M$, but it really has cost me so much time - which isn’t really a great incentive for other small businesses to switch to Linux.

I wonder if other distributions are simpler to use?

anyway, thanks for pointing me in the right direction.

I’m attempting to share my printer on my home network. I have done all that you have mentioned; but when I get to “Network… IPP … you should be able to listen for IPP broadcasts and as such detect your server” I don’t receive anything.

I’m sure this is something I have botched on my end, but can someone help me finish this?

I suggest switching of your firewall on the client and then watch the packets you get in your networkinterface with Wireshark(Install it with the software manager). This way you can see if you actually get any IPP packets. If there aren’t any switch of the firewall on the server. If you still don’t get any, then the server simply isn’t sending any or is sending them to the wrong subnet. You can check this with Wireshark on the server.

This way you will at least know where the problem lies. Then you can start finding out what it actually is.

Thanks for the reply. I installed Wireshark (nice application!), but I didn’t see ipp packets from the server. The localhost:631 cups website system responds with “recoverable: Network host ‘{servername}’ is busy; will retry in 15 seconds…”. The system will attempt to send a print signal forever with no results, apparently locked in a loop, or something.

I do have samba set up on the server, with samba ports open on the firewall (however, I have the firewall disabled until I get a connection). When using the localhost:631 cups website, the system responds with “/usr/lib/cups/backend/smb failed”. I have no idea what that means.

I checked to make certain the proper services were running; and they appear to be, on both server and client (one client only as of now).

As you have already guessed, I’m not computer network savvy; and it’s time I learned more. Much more.

I have read the Swerdna Howto on Linux to Linux printing, but the writer only explains the setup for OpenSuse 10.0 through 10.3, with quite a few differences between the versions.

I’m running 11.0.

Any other ideas?

If i understand correctly, you are sharing your printer on the server with samba and trying to connect to it with an IPP client. SMB (aka CIFS), implemented by samba, and IPP are two different protocols. So the IPP client, implemented by your local CUPS, isn’t going to be able to talk with a samba server.

The howto applies to IPP. If you want to connect to a samba-shared printer you will need to select the smb-networkprinter option instead of IPP in yast. (Yast -> Hardware -> printers -> add printer -> nerwork printer -> smb)

If cups on your server is correctly configured, in other words, if the printer there is up, running and shared, you should be able to configure CUPS through Yast to connect to the samba-shared printer. If you need more information on this search cups + samba + opensuse.

It’s not always hard, I the way I just got my Samsung ML-2010R working was so simple that I watched in awe as the ‘Print test page’ worked.

Server, automatically recognised it and installed the drivers.
Been a while since I did the settings but I don’t think I did any more then via the YaST printer tool select a radiobutton with “Allow remote access” and check the two checkboxes “For computers within the local network” “Publish printers by default within the local network”.

Client

  1. Search for ‘printer’ in kde4 menu, hit enter
  2. Select Print using network option
  3. Select Print directly via one remote CUPS-server
  4. Enter servers ip (192.168.1.100 in my case)
  5. Hit ok
    (back translating here,so wording might be off)

Now that was easier than any other printer install I ever did, even easier than windows as I did not have to install drivers. Now if the good folks at novell made a dropdown list out of all the IP’s in the same lan and a dropdown box instead of the ‘text field’ to enter the ip in… then it would be even easier.

Glad to hear of your success with it. As of now, I’ve tried IPP, LDP, and Samba to no avail.

I now wonder if the problem lies in the wireless router. My client is a laptop via wireless to the server. They see each other fine in Samba, but printing just isn’t happening.

Is there some top secret trick one has to do at the wireless router?

The only thing your wireless router can do wrong is block the tranmission with it’s firewall.

@mad-eng. Maybe with the three methods you tried, there are crossed communications now, and it might be time to clear some out and start again. So which one would you be focusing on now?

You’re right. At this point, anything is possible. Actually, IPP sounds like the best way to go, since it’s the printer protocol over TCP/IP.

At least I’ve been learning something through all this;).

I’ve followed the Swerdna instructions to the best of my knowledge; but obviously, I missed something.

I have IPP services running in the server and client; firewall disabled for now. Wireshark on the client end shows no IPP broadcasts that I can see (that doesn’t mean much coming from me).

As of now, I only have Samba running as the network protocol, which is fine. I have cleared out all other printer stuff, except for the local printer on the server (parallel port).

Any further help would certainly be appreciated.

Many thanks to all who have chimed in with some suggestions!

Could you post the file /etc/cups/cupsd.conf?

By the way, are you sure the printer is properly configured in cups? Can you go to http://localhost:631/ and print a testpage? The printer should also be published. There is a publish/unpublish ( = share/unshare) button in the printers tab.

I’ve read you are going for IPP but i just thought i’d let you know that i found an interesting page on Samba CUPS printing support.

“$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $”

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 info

Administrator user group…

SystemGroup sys root

Only listen for connections from the local machine.

Listen localhost:631
Listen <server IP address>:631
Listen /var/run/cups/cups.sock
#Port 631

Show shared printers on the local network.

Browsing On
BrowseOrder allow,deny
BrowseAllow @LOCAL

Default authentication type, when authentication is required…

DefaultAuthType Basic

Restrict access to the server…

<Location />
Order allow,deny
Deny From All
Allow From 127.0.0.1
Allow From 127.0.0.2
Allow From @LOCAL
Allow From <server IP address>.*
</Location>

Restrict access to the admin pages…

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

Restrict access to configuration files…

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

Set the default printer/job policies…

<Policy default>

Job-related operations must be done by the owner or an administrator…

<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 administrator to authenticate…

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

All printer operations require a printer operator to authenticate…

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

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
</Limit>

<Limit All>
Order deny,allow
</Limit>
</Policy>
BrowseAddress @LOCAL

End of “$Id: cupsd.conf.in 7199 2008-01-08 00:16:30Z mike $”.

Yeah, it prints fine via cups from the server.
Thanks for the read on Samba printing.

A few changes to the cupsd.conf, but first back up the existing one, perhaps with this command in a console:
sudo cp /etc/cups/cupsd.conf /etc/cups/cupsd.conf.backup

Open cupsd.conf for editing like this if KDE:
kdesu kwrite /etc/cups/cupsd.conf
or if Gnome use:
gnomesu gedit /etc/cups/cupsd.conf

original:

Only listen for connections from the local machine.

Listen localhost:631
Listen <server IP address>:631
Listen /var/run/cups/cups.sock
#Port 631

Tell to listen on port 631. Revise to this:

Only listen for connections from the local machine.

#Listen localhost:631
#Listen <server IP address>:631
#Listen /var/run/cups/cups.sock
Port 631

Notice reduced to one line only.

original:

Restrict access to the server…

<Location />
Order allow,deny
Deny From All
Allow From 127.0.0.1
Allow From 127.0.0.2
Allow From @LOCAL
Allow From <server IP address>.*
</Location>

Open comms for your network. use “sudo /sbin/ifconfig” do discover your IP address. In this example we use 10.0.33.9. Modify to suit your situation. Now revise to this (three lines altered):

Restrict access to the server…

<Location />
Order deny,allow
Deny From All
Allow From 127.0.0.1
Allow From 127.0.0.2
#Allow From @LOCAL
Allow From 10.0.33.*
</Location>

Remember to change 10.0.33.* to your IP1.IP2.IP3.*. Notice deny first. Notice comment out @Local

I’ve been prompted to revise my tutorial for 11.1. There are some changes that might affect you. In particular you need to check the mime-types that come from a client. The server needs to be set to accept “application/octet-stream”, which is allowed in one of 11.1’s config files but missed in the other (oversight?? maybe needs a bug report). The new stuff is in here in greater detail:
Linux Printer Sharing: Suse/openSUSE 10.x 11.x IPP Print Server for Linux & Windows Clients

I suppose I should revise the Samba one too.

OK, I made the changes listed above; still no success. But I believe I have found a broken link. I can ping the client from the server, and vice-versa just fine. However, when I attempt to see the server printer via cups, here’s what happens:

On the client I open firefox, and enter http://<server ip>:631/printers/

What I get is a big fat 405 forbidden. This is with both firewalls disabled.

What would cause that :frowning: ?

That’s not too important. It’s not a firewall thing. It’s a security imposed separately by cups for your protection. You’re using the settings for 11.0 in cupsd.conf. Try clearing the browser cache. Might help. All it means is that you have a setting in 11.0’s cupsd.conf that limits access from remote computers.

Back to the problem: did you fix the mime types in the files mime.convs and mime.types? They block raw format printing as used in IPP. You have to unblock it. See the segment “Check mime types” in my tutorial.