LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Desktop (https://www.linuxquestions.org/questions/linux-desktop-74/)
-   -   Can not access CUPS Administration (https://www.linuxquestions.org/questions/linux-desktop-74/can-not-access-cups-administration-930737/)

Baasha 02-22-2012 01:24 PM

Can not access CUPS Administration
 
Hi,

I am running Ubuntu 11.10. I am trying to setup a new printer but when I go to localhost:631/admin it won't let me enter any of the options. CUPS does not ask me for a username and password. If I click on any of the menu items in the admin page it just reverts back to the same page.

I have uninstalled and re-installed cups several times to try and correct the problem, but no change. I even did a complete system re-install in case there was a configuration file somewhere that I had missed.

I have another computer, with the same operating system, on the same network that can acess the printer with no problems.

I'm stumped. Does anyone have any ideas?

ButterflyMelissa 02-22-2012 01:30 PM

Did you try
Quote:

127.0.0.1:631
without anything else? Maybe by entering the admin page, you skipped login...

Thor

Baasha 02-22-2012 02:38 PM

That is exactly the point. The login dialogue doesn't show up when I attempt any of the admin functions. I am assuming that is why I can't make changes. So how do I change that?

ButterflyMelissa 02-22-2012 09:58 PM

I asume you're not in some root account but in a daily account...

DavidMcCann 02-23-2012 12:14 PM

You might try these ideas (off the top of my head: I don't know much about Ubuntu):

1. Don't use CUPS: use the Ubuntu printer configuration tool.

2. Open a terminal and do "sudo bash" followed by "firefox" (or whatever you use) and then try accessing CUPS.

Baasha 02-23-2012 07:15 PM

@Thor

I have tried opening CUPS both ways, as a user and by starting Firefox with sudo. Still can't get in. The way CUPS should work is that anytime you want to do Admin functions it will ask for your username and password, but on this machine it doesn't.

@David

The Ubuntu printer config. tool doesn't do much. As far as I can tell it only lets your system know there is a printer connected to the network. AFAIK you have to use CUPS to to actually do any configuration, set up default options, etc. This is absolutely necessary in my case as I do most of my printing from LibreOffice. Unfortunately, LO and its predecessor OpenOffice has a bug in it that the developers haven't gotten around to fixing yet. LO uses the printer defaults to print, i.e. you can't change them from the printer dialogue in LO. The only workaround I know for this is to set up two or more instances of the same printer, each one configured with a preferred set of options. It makes for a lot of work but at least you can print something the way you want. But you have to do all that using CUPS, hence the headache I am experiencing.

Any other ideas will be welcome. Thanks for your help so far.

ButterflyMelissa 02-24-2012 09:08 AM

Waitwaitwaitwait....

Just a flash...you're running the Cusp Daemon (cupsd), so you're in escence running a webserver. Are you "belssed" with more than one box? If so, try to access that machine ans see if you can get on to the cups page. Look up the processlist, I suspect cupsd to be in there.
The conf file is set up so the web interface has restricted access. In the conf file (typically /etc/cups/cupsd.conf), try to edit it, this should be in there:

Quote:

Order deny, allow
Deny fro all
Allow from 127.0.0.1
Restart the server, you know how:
Quote:

sevice cups restart
Let's see where this thing lands...

Thor

Baasha 02-25-2012 01:04 PM

Hi Thor,

I am unsure exactly where the lines of code you suggested should go in the file. Here is my /etc/cups/cupsd.conf file. I have compared the same file from both machines and they are identical, except one works and the other doesn't.

Quote:

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

#
#

ButterflyMelissa 02-25-2012 02:30 PM

Hi, does this group exist on the faulty box?
Quote:

lpadmin
Try this, add the lines (in red) to the section

Quote:

# Restrict access to the admin pages...
<Location /admin>
Order allow,deny
Deny from all
Allow from 127.0.0.1
</Location>
And restart the service...by now, you know how ;)

Thor

Baasha 02-25-2012 05:02 PM

Hi Thor,

Yes, lpadmin is a valid group on both machines and I am a member of it.

I added those two lines, that you suggested, to the cupsd.conf file on the machine that doesn't work and then restarted, but unfortunately I still can't access the cups admin functions.

Thx for your patience and help in dealing with this problem.

ButterflyMelissa 02-25-2012 05:05 PM

Quote:

Thx for your patience and help in dealing with this problem.
Dont worry, this is fun for me (seriously) :)
Let's hope we get to a result...

By the way, how did the tips of DavidMcCann (post 5) work out?
Lemme meditate, please...

Thor

Cedrik 02-27-2012 03:57 AM

Maybe look in the logs ?

/var/log/cups/access_log
/var/log/cups/error_log

(The logs may be elsewhere in Ubuntu, I use Slackware...)

Baasha 02-27-2012 01:22 PM

Hi Cedrik,

Here is the cups access log which seems to indicate no problem (although there is):

Quote:

localhost - - [26/Feb/2012:11:39:51 -0800] "POST / HTTP/1.1" 200 182 Renew-Subscription successful-ok
localhost - - [26/Feb/2012:12:38:11 -0800] "POST / HTTP/1.1" 200 182 Renew-Subscription successful-ok
localhost - - [26/Feb/2012:13:06:56 -0800] "POST / HTTP/1.1" 200 151 Cancel-Subscription successful-ok
localhost - - [26/Feb/2012:14:50:29 -0800] "POST / HTTP/1.1" 200 359 Create-Printer-Subscription successful-ok
localhost - - [26/Feb/2012:14:50:36 -0800] "POST / HTTP/1.1" 200 359 Create-Printer-Subscription successful-ok
localhost - - [26/Feb/2012:15:48:56 -0800] "POST / HTTP/1.1" 200 182 Renew-Subscription successful-ok
localhost - - [26/Feb/2012:16:47:16 -0800] "POST / HTTP/1.1" 200 182 Renew-Subscription successful-ok
localhost - - [26/Feb/2012:17:45:36 -0800] "POST / HTTP/1.1" 200 182 Renew-Subscription successful-ok
localhost - - [26/Feb/2012:17:57:15 -0800] "POST / HTTP/1.1" 200 151 Cancel-Subscription successful-ok
localhost - - [26/Feb/2012:19:46:13 -0800] "POST / HTTP/1.1" 200 359 Create-Printer-Subscription successful-ok
localhost - - [26/Feb/2012:20:04:11 -0800] "POST / HTTP/1.1" 200 151 Cancel-Subscription successful-ok
localhost - - [27/Feb/2012:10:24:10 -0800] "POST / HTTP/1.1" 200 359 Create-Printer-Subscription successful-ok
localhost - - [27/Feb/2012:10:38:11 -0800] "POST /admin/ HTTP/1.1" 200 66 - -
localhost - - [27/Feb/2012:10:38:11 -0800] "POST /admin/ HTTP/1.1" 200 5578 - -
And here is the cups error log which is saying something about a dbus problem:

Quote:

W [26/Feb/2012:14:50:11 -0800] failed to CreateProfile: org.freedesktop.DBus.Error.NoReply:Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
W [26/Feb/2012:19:45:42 -0800] failed to CreateProfile: org.freedesktop.DBus.Error.NoReply:Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
W [27/Feb/2012:10:23:50 -0800] failed to CreateProfile: org.freedesktop.DBus.Error.NoReply:Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
I reinstalled dbus but that didn't make any difference. The log says it is possibly a network connection problem, but I can ping the printer successfully, and I have replaced the cable just to be sure, but still no joy.

Cedrik 02-27-2012 01:50 PM

Could you try to :
go to http://localhost:631/admin
click on add printer
click on view access log and error log

Just to see if something change

Also, did you try different web browsers to access cups ?

Baasha 02-27-2012 02:30 PM

Quote:

Originally Posted by Cedrik (Post 4613398)
Could you try to :
go to http://localhost:631/admin
click on add printer
click on view access log and error log

Just to see if something change

Also, did you try different web browsers to access cups ?

There were no changes in the logs when I tried to add printer.

Ahaa, when I tried to access admin functions from Chromium I got the proper request for username and password. Does this mean there is something in Firefox that is screwed up?


All times are GMT -5. The time now is 07:57 AM.