omon23
Posts: 8
Joined: Sat Nov 30, 2013 9:44 am

CUPS Server - Forbidden

Tue Jan 12, 2016 7:21 pm

(please move to the correct section if this is the wrong section)

Hello,

I have recently installed the CUPS printing server on my Raspberry Pi. I had installed it fine and everything would work and print OK - the only problem was that every time I went to go to administrate the printer I added, it would come up with a 'Forbidden' message. I just ignored that as I didn't think I would need to administrate it as I had set up the settings when I installed the printer.

Now today, I was trying to print something and the server got 'stuck' meaning it would not print anything and was showing as 'paused' on my PC (running Windows 10). I had tried a lot of configuration options, and searched on Google - unfortunately nothing worked for me. Eventually I decided to just reset my Pi and I re-installed Raspbian on to it.

I've reinstalled CUPS again but I am still getting the same forbidden message (I only get this when I go to https://<ip-address>:631/printers/<printer>, which is the same issue as before):

Image

I want to be able to fix this error but I am not sure how - so I came to this forum. Any help is appreciated.

Here is my cupsd.conf:

Code: Select all

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

# Only listen for connections from the local machine.
# Listen localhost:631
Port 631

Listen /var/run/cups/cups.sock

# Show shared printers on the local network.
Browsing On
BrowseLocalProtocols dnssd

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

# Web interface setting...
WebInterface Yes

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

# Restrict access to the admin pages...
<Location /admin>
  Order allow,deny
  Allow @local
</Location>

# Restrict access to configuration files...
<Location /admin/conf>
  AuthType Default
  Require user @SYSTEM
  Order allow,deny
  Allow @local
</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>

#
#

Here is the error log:

Code: Select all

E [12/Jan/2016:18:58:43 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:58:47 +0000] [Client 21] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:58:49 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:58:52 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:58:54 +0000] [Client 21] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:58:56 +0000] [Client 22] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:58:56 +0000] SSL shutdown failed: Error in the push function.
E [12/Jan/2016:18:58:56 +0000] SSL shutdown failed: Error in the push function.
E [12/Jan/2016:18:58:56 +0000] SSL shutdown failed: Error in the push function.
E [12/Jan/2016:18:59:03 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:59:05 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:59:07 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:59:09 +0000] [Client 20] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:59:12 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:59:14 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:59:16 +0000] [Client 20] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:59:18 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:18:59:23 +0000] [Client 18] pam_authenticate() returned 7 (Authentication failure)
E [12/Jan/2016:19:01:07 +0000] SSL shutdown failed: Error in the push function.
W [12/Jan/2016:19:02:21 +0000] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'Dan's_Printer-Gray..' already exists
W [12/Jan/2016:19:02:21 +0000] CreateProfile failed: org.freedesktop.ColorManager.AlreadyExists:profile id 'Dan's_Printer-RGB..' already exists
E [12/Jan/2016:19:02:23 +0000] [Client 18] Request for non-absolute resource "/printers/Dan's_Printer".
E [12/Jan/2016:19:13:17 +0000] [Client 17] Request for non-absolute resource "/printers/Dan's_Printer".

If you need anything else, please let me know.

Many Thanks,
Dan.

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: CUPS Server - Forbidden

Tue Jan 12, 2016 7:25 pm

Did you make youself a member of the lpadmin group ??

http://www.penguintutor.com/linux/printing-cups
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

omon23
Posts: 8
Joined: Sat Nov 30, 2013 9:44 am

Re: CUPS Server - Forbidden

Tue Jan 12, 2016 8:00 pm

fruitoftheloom wrote:Did you make youself a member of the lpadmin group ??

http://www.penguintutor.com/linux/printing-cups
Yes, I have added the pi user to the lpadmin group.

User avatar
rangioran
Posts: 20
Joined: Tue Jul 24, 2012 10:11 am
Location: North Shropshire

Re: CUPS Server - Forbidden

Fri Dec 06, 2019 5:20 pm

fruitoftheloom wrote:
Tue Jan 12, 2016 7:25 pm
Did you make youself a member of the lpadmin group ??

http://www.penguintutor.com/linux/printing-cups
Excellent! Thanks fruitoftheloom :D
The older I get the more certain I become that it's everyone else that's wrong and unable to realise it :D

fruitoftheloom
Posts: 23337
Joined: Tue Mar 25, 2014 12:40 pm
Location: Delightful Dorset

Re: CUPS Server - Forbidden

Fri Dec 06, 2019 5:32 pm

rangioran wrote:
Fri Dec 06, 2019 5:20 pm
fruitoftheloom wrote:
Tue Jan 12, 2016 7:25 pm
Did you make youself a member of the lpadmin group ??

http://www.penguintutor.com/linux/printing-cups
Excellent! Thanks fruitoftheloom :D

Please note that after 5 years this whole post is out of date when using Raspbian Buster. :shock:
Rather than negativity think outside the box !
RPi 4B 4GB (SSD Boot)..
Asus ChromeBox 3 Celeron is my other computer...

Return to “Troubleshooting”