LinuxQuestions.org
Review your favorite Linux distribution.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Desktop
User Name
Password
Linux - Desktop This forum is for the discussion of all Linux Software used in a desktop context.

Notices

Reply
 
Search this Thread
Old 02-22-2012, 01:24 PM   #1
Baasha
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Rep: Reputation: 0
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?
 
Old 02-22-2012, 01:30 PM   #2
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,210
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
Did you try
Quote:
127.0.0.1:631
without anything else? Maybe by entering the admin page, you skipped login...

Thor
 
Old 02-22-2012, 02:38 PM   #3
Baasha
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Original Poster
Rep: Reputation: 0
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?
 
Old 02-22-2012, 09:58 PM   #4
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,210
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
I asume you're not in some root account but in a daily account...
 
Old 02-23-2012, 12:14 PM   #5
DavidMcCann
Senior Member
 
Registered: Jul 2006
Location: London
Distribution: CentOS, Salix
Posts: 3,067

Rep: Reputation: 788Reputation: 788Reputation: 788Reputation: 788Reputation: 788Reputation: 788Reputation: 788
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.
 
Old 02-23-2012, 07:15 PM   #6
Baasha
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Original Poster
Rep: Reputation: 0
@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.
 
Old 02-24-2012, 09:08 AM   #7
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,210
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
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
 
Old 02-25-2012, 01:04 PM   #8
Baasha
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Original Poster
Rep: Reputation: 0
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>

#
#
 
Old 02-25-2012, 02:30 PM   #9
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,210
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
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
 
Old 02-25-2012, 05:02 PM   #10
Baasha
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Original Poster
Rep: Reputation: 0
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.
 
Old 02-25-2012, 05:05 PM   #11
Thor_2.0
Senior Member
 
Registered: Nov 2007
Location: Somewhere on my hard drive...
Distribution: Manjaro
Posts: 2,210
Blog Entries: 23

Rep: Reputation: 279Reputation: 279Reputation: 279
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

Last edited by Thor_2.0; 02-25-2012 at 05:09 PM.
 
Old 02-27-2012, 03:57 AM   #12
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
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...)
 
Old 02-27-2012, 01:22 PM   #13
Baasha
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Original Poster
Rep: Reputation: 0
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.NoReplyid 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.NoReplyid 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.NoReplyid 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.
 
Old 02-27-2012, 01:50 PM   #14
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
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 ?
 
Old 02-27-2012, 02:30 PM   #15
Baasha
LQ Newbie
 
Registered: Jul 2006
Posts: 14

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by Cedrik View Post
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?
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CUPS Remote Administration nominruil Linux - Server 6 06-08-2012 10:46 AM
LXer: System Administration Toolkit: Distributed administration using SSH LXer Syndicated Linux News 0 08-15-2007 07:20 AM
Remote Administration Access in IPCop not working? depam Linux - Software 3 03-30-2007 12:25 AM
CUPS Administration with USB Printer Dymitry Linux - Hardware 4 12-14-2006 09:44 PM
CUPS web-administration interface on SuSE 9.1 LUB997 Linux - Hardware 1 03-09-2005 02:16 AM


All times are GMT -5. The time now is 03:04 PM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration