macOS Printing – Cannot Print to Shared Printer from Other Computers

macosNetworkprintingsharing

I have a HP CP1515n laser printer, connected to my iMac (running Sonoma) with an Ethernet cable, basically forming a very small network with statically configured IP addresses. Printing locally works fine.

I have turned on printer sharing on the iMac, hoping to be able to use the printer from other computers on the same WiFi network. This setup used to work fine with the same printer on an older iMac, running Big Sur.

Other computers "see" the shared printer (via Bonjour, I guess), but when I try to print to it from another Mac (my work laptop, with completely different credentials) i get a queue window that says "Hold for authentication", and when trying from a Windows laptop that just says "Can’t print", with no useful information at all.

What is this authentication? How do I turn it off, so that the iMac happily accepts print jobs from anyone on the same network? (Or anyone at all — it’s firewalled/NAT:ed off, anyway…)

(Yes, since the printer speaks IPP/IP anyway, it would be nice to get the printer on the same network as everything else, taking the iMac out of the equation. Unfortunately, the printer only has wired Ethernet while everything else in on WiFi, so that requires either running a looong Ethernet cable to where the WiFi base station is, or finding some sort of device that can connect to an existing WiFi network and L2 bridge it to an Ethernet cable. Hm, can an old Airport Extreme do that? I have one gathering dust…)

Best Answer

Partial answer to my own question. After applying the following voodoo, I can at least print from a Raspberry Pi on the same network. There was quite a lot of experimentation involved, so some steps may be unnecessary, and there may be things missing because I failed to write them down...

  1. Enable the CUPS web interface: sudo cupsctl WebInterface=yes

  2. In the CUPS web interface, find the "edit the cupsd.conf file" option, and add a line saying Listen *:631. (You can probably do this directly in the file system, making the previous step unnecessary). This will make the CUPS daemon listen on all interfaces, which may be a bad idea on an Internet facing computer!

  3. Run lpstat -p to find out the name of the printer. In my case, it was something with lots of underscores in it.

  4. Run lpadmin -p $NAME -u allow:all, where $NAME is the name found out in the previous step. This allows printer access to all users, apparently eliminating the need for authentication.