cannot print from shared printer in Ubuntu?

November 4th, 2007
Sharing and using a printer in Ubuntu has turned to a very simplified procedure. However there may be a tiny bit of extra homework you have to do.

By default the CUPS is configured to accept incoming connections only from localhost (yes, I find it kind of odd, too... what's the point of printer sharing if restricted only to local host?).

To fix this you have to edit your /etc/cups/cupsd.conf configuration file:

sudo gedit /etc/cups/cupsd.conf

Go to the section for the listeners configuration (it is not far from the beginning of the file):

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


As you can see it is configured to accept connections only from localhost. Replace localhost with an asterisk to allow incoming connection from outside:

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


Restart the CUPS system:

sudo /etc/init.d/cupsys restart

Now you should be able to set up network printers from the other computers and use the printer.

6 Responses to “cannot print from shared printer in Ubuntu?”

  1. HILARY WRIGHT Says:
    Hello Giannis,

    I am having real trouble sharing a locally attached printer to other client machines on my Gutsy Ubuntu network. All the machine run 7.10 Gutsy. All of them have had the latest Avahi patches installed. CUPS is configured correctly to share the published printer on the server and the client machines are set up to browse for shared printers.

    The problem is that when I turn on the server machine in the morning, the client machines cannot see the shared printer at all. If I go to a terminal and restart cups on the sever machine as above (without making any change to the config files), hey presto, the client machines see the printer and I can print with no problem.

    Do you have any ideas?

    Thank you in advance

    Hilary

    PS here is the server config file, it is the std config file, with no changes.

    LogLevel warning
    SystemGroup lpadmin
    # Allow remote access
    Port 631
    Listen /var/run/cups/cups.sock
    # Share local printers on the local network.
    Browsing On
    BrowseOrder allow,deny
    BrowseAddress @LOCAL
    DefaultAuthType Basic

    # Allow shared printing...
    Order allow,deny
    Allow @LOCAL

    # Restrict access to the admin pages...
    Order allow,deny
    Allow localhost

    AuthType Default
    Require user @SYSTEM
    # Restrict access to the configuration files...
    Order allow,deny
    Allow localhost


    Require user @OWNER @SYSTEM
    Order deny,allow


    AuthType Default
    Require user @SYSTEM
    Order deny,allow


    AuthType Default
    Require user @SYSTEM
    Order deny,allow


    Require user @OWNER @SYSTEM
    Order deny,allow


    Order deny,allow
  2. giannis Says:
    Hilary,
    your problem seems kind of odd, I cannot think of something specific. Maybe it has nothing to do with CUPS at all, perhaps it is a side effect caused by another piece of software. I've heard that AppArmor was responsible for failure on CUPS on some systems, but that's not necessarily your case.
    I would suggest you (if possible) to use a minimal configuration at first, to make sure everything works, and then add packages and services while tracking the behaviour of the system. Maybe this can help you find the misfit...
    Sorry that I cannot help you any better.
    Cheers
  3. Thomas Novin Says:
    ..or you can just from Printer Configuration check the "Allow remote administration" box.
  4. Ashish Bansal Says:
    Restart the CUPS system:
    -----------------------
    On Ubuntu 8.10 (Intrepid Ibex) i think the command is

    sudo /etc/init.d/cups restart instead of

    sudo /etc/init.d/cupsys restart
  5. Tom Younker Says:
    Using Ubuntu 8.04 host, from Win2000 in VirtualBox, I got an "access denied" message in Add Printer dialog, until adding this "Allow from" line to cupsd.conf:
    # Restrict access to the server...

    Order allow,deny
    Allow from 10.0.1.*
  6. Adam Says:
    Thanks Ashish! That's the command on 9.04 / Jaunty Jackalope also.

Leave a Reply