3

I have four printers if I go to dash and then printers. However, if when I print in the dialog there are many printers (100?) that show up that I have never seen/installed. I'm guessing they're network printers. How can I remove them or prevent them from showing up?

This problem only started happening on 14.04.

my file /etc/cups/cupsd.conf is below

#
#
# Sample configuration file for the CUPS scheduler.  See "man cupsd.conf" for a
# complete description of this file.
#

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

# Deactivate CUPS' internal logrotating, as we provide a better one, especially
# LogLevel debug2 gets usable now
MaxLogSize 0

# Administrator user group...
SystemGroup lpadmin


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

# Show shared printers on the local network.
Browsing Off
BrowseOrder allow,deny
BrowseAllow all
BrowseLocalProtocols CUPS dnssd
BrowseAddress @LOCAL

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

# Web interface setting...
WebInterface Yes

# Restrict access to the server...
<Location />
  Order allow,deny
</Location>

# Restrict access to the admin pages...
<Location /admin>
  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/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    Order deny,allow
  </Limit>

  <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 Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    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 CUPS-Get-Devices>
    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 Cancel-Jobs 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>

# Set the authenticated printer/job policies...
<Policy authenticated>
  # Job/subscription privacy...
  JobPrivateAccess default
  JobPrivateValues default
  SubscriptionPrivateAccess default
  SubscriptionPrivateValues default

  # Job-related operations must be done by the owner or an administrator...
  <Limit Create-Job Print-Job Print-URI Validate-Job>
    AuthType Default
    Order deny,allow
  </Limit>

  <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 Cancel-My-Jobs Close-Job CUPS-Move-Job CUPS-Get-Document>
    AuthType Default
    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 Cancel-Jobs 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>
    AuthType Default
    Require user @OWNER @SYSTEM
    Order deny,allow
  </Limit>

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

#
#
Xu Wang
  • 347
  • 2
  • 4
  • 14

2 Answers2

6
  1. Open Firefox or any browser on: http://localhost:631/
  2. Administrations tab → Under Server title, Edit Configuration File
  3. Look for Browsing/BrowseLocalProtocols and set them to:

    Browsing Off
    BrowseLocalProtocols none
    

    then Save Changes

  4. Enter your username/password, done

If you prefer command line:

sudo nano /etc/cups/cupsd.conf
user.dz
  • 48,105
  • Good idea but unfortunately Browsing was already set to On. Note that I also have the following in my cupsd.conf.

    Show shared printers on the local network.

    Browsing Off BrowseOrder allow,deny BrowseAllow all BrowseLocalProtocols CUPS dnssd BrowseAddress @LOCAL

    – Xu Wang Jul 15 '14 at 02:17
  • Although I get errors in /var/log/cupsd/error: [14/Jul/2014:22:09:59 -0400] Unknown directive BrowseOrder on line 25 of /etc/cups/cupsd.conf. E [14/Jul/2014:22:09:59 -0400] Unknown directive BrowseAllow on line 26 of /etc/cups/cupsd.conf. E [14/Jul/2014:22:09:59 -0400] Unknown browse protocol "CUPS" ignored. E [14/Jul/2014:22:09:59 -0400] Unknown directive BrowseAddress on line 28 of /etc/cups/cupsd.conf. Also note that I think if you edit by command line you must run sudo /etc/init.d/cups restart (I'm sure you knew this but just putting for archiving objectives). Any other ideas? – Xu Wang Jul 15 '14 at 02:17
  • @XuWang, updated answer. Those errors are wrong syntax in /etc/cups/cupsd.conf , could you post its contents to verify. yes, cups must be restarted. I just find a similar question I have seen it before but i could find through search, It may help too https://askubuntu.com/questions/345083/how-do-i-disable-automatic-remote-printer-installation/ – user.dz Jul 15 '14 at 03:46
  • I added the cupsd.conf file. Thank you for finding the other question. I appreciate your time. Unfortunately I tried the answer by Steve Besch and it did not change anything for me. – Xu Wang Jul 16 '14 at 22:32
  • @XuWang, concerning errors, I copied yours and replaced cupsd.conf, restarted and no error. Have BrowseLocalProtocols none, i've updated my answer? – user.dz Jul 17 '14 at 03:53
  • 1
    I still cannot get things to work. I will accept your answer though because I think it might be an answer to same problem but different context. Thank you for your efforts. – Xu Wang Jul 23 '14 at 18:55
1

I thinnk best solution is to disable cups-browsed (this avoid autodetection but not the use of other remote printers):

sudo gedit /etc/cups/cups-browsed.conf

and change the line of BrowseRemoteProtocols to:

BrowseRemoteProtocols none

then restart system (or run sudo service cups-browsed restart).

arauzo
  • 998