CUPS issue - Ventura and Sonoma mostly

Contributor III

Hello all! I am trying to reverse a script that was run when we setup a new Windows Print Server. We were having a tough time getting Mac's to print using printers hosted on the print server. We tried both SMB and LPT protocols and had no real success. I then tried the following bit of code to attempt to remediate the problem (occasionally we would get the "Hold for authentication" message when viewing the print job in the computers print queue):


for PRINTER in `lpstat -v | grep 'lpd://' | awk '{print $3}' | tr -d :`
    lpadmin -p $PRINTER -o auth-info-required=negotiate


This helped just a few people, but not everyone. What it did do was freak out all of our faculty that print. We are bound to AD for a variety of reasons, but they just couldn't figure out that the credentials that were being asked for were the same they use for literally everything else on their computer.

After a few months of trying to figure out why Mac's couldn't print, I stumble upon the fact that all the Mac's that can't print, they are on the wrong VLAN. (Thanks network guy who kept saying the network wasn't the problem...he hates Mac's) So, now that we have moved them to the proper network, new computers that haven't had the script above run on them print just fine.

I am trying to figure out how I can remove that line from the SMB/LPT printers that are installed on existing users computers so they don't have to freak out having to use their credentials.


Contributor III

At the most basic, what you are trying to do is essentially:

# Find out if the driver files need to be fixed
AllPrinters=$(ls /private/etc/cups/ppd)

for ppd in $AllPrinters
	sed -i '' '/auth-info-required=negotiate/d' "/private/etc/cups/ppd/$ppd"

Honored Contributor II

Try tossing this into the mix.

echo "[libdefaults]" | sudo tee -a /etc/krb5.conf; echo "default_realm =" | sudo tee -a /etc/krb5.conf