Ubuntu 11.11: No printers available to add

Asked by LEGOManiac

I've installed 11.11 and tried to add my two network printers. The System Settings>Printers dialogue box says there are no printers available and the button to add one is greyed out.

I can access the web pages of both printers.

Question information

Language:
English Edit question
Status:
Solved
For:
Ubuntu cups Edit question
Assignee:
No assignee Edit question
Solved by:
actionparsnip
Solved:
Last query:
Last reply:
Revision history for this message
Best actionparsnip (andrew-woodhead666) said :
#1

try:

gksudo firefox http://localhost:631

You can add a printer there

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#2

@actionparnip
Why do you have to run Firefox as root for this?? An HTTP connection *from* the root user is not going to be more privileged than a connection from any other user...

Shouldn't it work just as well to go to http://localhost:631 ?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#3

as far as I am aware the cups service needs to be accessed as root to apply the printer that way. Could try without, see if there is an access denied message etc.

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#4

But running Firefox as root and using that to access cups via the web-based interface doesn't really access it **as root**, does it? Does the cups service have the ability to discriminate between different accesses on the loopback interfaces by the user account running the HTTP client?

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#5

The process runs as root, so I guess it would. The owning UID of the process would be root's

I've had to do it in the past but maybe there is some cheeky polkit / permissions niceness going on which makes it not necessary now. Wortha try without it just for kicks

Revision history for this message
Eliah Kagan (degeneracypressure) said :
#6

In chromium-browser running as ek, who on my machine is not the superuser but is an administrator, I clicked "Adding Printers and Classes" (http://localhost:631/admin). This brought me to a screen where I was presented with various categories of configuration changes I could attempt to make (Printers, Classes, Jobs, Server, and RSS Subscriptions). Under Printers, I clicked the Add Printer command button. I was prompted to enter a username and password. I entered ek as the username and ek's password as the password, which was accepted as a successful authentication. This brought me to the Add Printer page (the page providing options to add local or network printers).

Then I ran chromium-browser as root with: [0]

gksu 'chromium-browser --user-data-dir=/root/.config/chromium'

The behavior was identical--I was still prompted for a username and password (and ek's username and password still worked--I couldn't enter root and root's password, since root has no password[1], since actual root logins are disabled that way as is standard and recommended on Ubuntu systems).

This is what I expected. The owner of the web browser process is root, but since it is connecting to the server via TCP/IP, that doesn't matter. Access to the CUPS web based administration server is (on many systems) restricted by network interface, but I am not aware of any reasonable way to restrict it by user[2]. To the best of my knowledge, the user ID that runs the client process is not accessible to the server from any information sent via TCP/IP or (at the application-layer protocol level) HTTP.

Similarly[3], if you have a user account on your computer and a user account on my computer, and your user account on my computer includes some kind of web access, being logged in as a user account on your computer that has the same name as the user account on my computer would not be relevant to what web access my computer affords you.

"I've had to do it in the past"

Can you provide more details? I am having trouble imagining how running the web browser as root could ever help, in authenticating with a CUPS server.

[0] "gksu chromium-browser" or "gksudo chromium-browser" without arguments fail by chromium-browser's design. Chromium refuses to run as root unless you manually specify where you want it to put configuration information, presumably to prevent otherwise easily made mistakes involving not thinking through where one wants one's per-user configuration to be written.

[1] I know you know this actionparsnip, but for others' benefit: No user account password and a blank user account password are very different things. A blank password makes it trivially possible to log in to an account. No password makes password authentication impossible. Please note that this is specific to user account passwords, though--for example, a blank keyring password really is equivalent to no keyring password, in that it causes no password encryption to occur.

[2] An unreasonable way to do this would be with a driver that monitored all outgoing HTTP connections on the loopback interface and checked what user owned the processes that created them.

[3] There is, of course, a limit to this comparison. Unreasonable ways to make my computer know what user account you're using on your computer across a TCP/IP connection are way more unreasonable than unreasonable ways to make my computer know what user account I am using on my computer across a TCP/IP connection.

Revision history for this message
actionparsnip (andrew-woodhead666) said :
#7

Ahhh I see, well it not only makes life easier for users but I also learned today. Thanks for checking it out :)

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#8

For what it's worth, I used Opera as a regular user and was prompted for username/password before being allowed to make changes.

I suppose in one sense, my problem is solved in so far as I was able to install my printers. Fortunately, as a network admin, I knew what I was doing, but the web interface for CUPS presents way too many options for the average user to navigate easily. The old method of using the add printer dialogue worked like a charm and didn't require the user to know the difference between http, ipp, socket, and lpd access methods. They've managed to take a brain-dead simple setup routine and kill it, forcing users to use a much more ambiguous method. Dumb, very dumb. I suppose it's possible, however, that it's just a bug that the usual printer dialogue doesn't allow setting up printers.

Ubuntu 11.11, takes yet another step backwards. (don't get me going on Unity)

Anyway, thanks Actionparsnip for pointing me in the right direction.

Revision history for this message
LEGOManiac (bzflaglegomaniac) said :
#9

Thanks actionparsnip, that solved my question.

Revision history for this message
Tong Sun (suntong001) said :
#10

so what is the solution, please?
I've read the whole thread through but didn't find more details than "the old method of using the add printer dialogue worked".

Please help.
Thanks

Revision history for this message
Tong Sun (suntong001) said :
#11

I meant, to the problem of, "I clicked "Adding Printers and Classes" (http://localhost:631/admin). This brought me to a screen where I was presented with various categories of configuration changes I could attempt to make (Printers, Classes, Jobs, Server, and RSS Subscriptions). Under Printers, I clicked the Add Printer command button. I was prompted to enter a username and password."

Since Ubuntu does not have a root password by default, how should I by pass such prompt and add printers? I don't want to set the root password, because that'd defeat the purpose of not having a root password!

Thanks

Revision history for this message
Tong Sun (suntong001) said :
#12

Ok, found it.
https://help.ubuntu.com/10.04/serverguide/cups.html

In order to perform administrative tasks via the web interface, you must either have the root account enabled on your server, or authenticate as a user in the lpadmin group.

To add a user to the lpadmin group, run at the terminal prompt:

sudo usermod -aG lpadmin username