Someone gave me a used color ink printer as a gift. This printer doesn’t have a network interface so i had to look for a way to connect it to my home network. I didn’t want to buy a small print server because they are not really cheap and it would be another power consuming device. My home router has a USB interface and can be used as a print server; unfortunately the router is in the wrong room.
But there is a Raspberry Pi in the same room as the printer and i use it already for some server tasks. So i installed CUPS on it and tried to get access to http://servername:632/admin (the admin website of CUPS). But the server answered with „Forbidden“.
I searched through several log files but couldnt find any related error message. A quick search through the CUPS config file also didn’t gave any hint what was wrong. I suspected a problem with my NGINX web server (that i use instead of the resource consuming Apache), but everything looked unsuspicious.
On the command line i looked for any tool that started with „cups“ and there i found „cupsctl“. When i ran it without any parameter the output was:
„remote_admin“ looked like something promising; but i had to find out when to use 0 or 1.
So i ran „cupsctl -?“ and the (shortened) output was
–[no-]debug-logging Turn debug logging on/off.
–[no-]remote-admin Turn remote administration on/off.
–[no-]remote-any Allow/prevent access from the Internet.
–[no-]remote-printers Show/hide remote printers.
–[no-]share-printers Turn printer sharing on/off.
–[no-]user-cancel-any Allow/prevent users to cancel any job.
I typed in „cupsctl –remote_admin“ and the again „cupsctl“. Now the line was
Now i was able to get access to the admin web page.
PS: a Google search returned a discussion where the workaround was to run „system-config-printer“ as root. For me such advice look like some dirty hack…
PS II: I still couldn’t login because my user wasnt in the correct group and the root user isn’t enabled on the Raspberry Pi by default. After i ran „usermod -aG lpadmin insertyouruserhere“ i was able to log in.