Thursday, January 22, 2015

Mac OSX "Hold for authentication" when trying to print

Today I tried to get printing to work from my mac (running Yosemite) to the printers here at work.  The printers are accessed using SMB.

I could easily add the printers, but when I tried to print, it would accept my username and password for the printer, but then revert straight back to saying "Hold for authentication".

Deleting the printers and recreating them didn't fix it.
Nor did deleting the associated entries from the OSX keyring help.

Thus the usually recommended steps failed to fix the problem.

It took a couple of hours of research and experimentation to discover that this page had most of the information needed to solve the problem.

The problem in my case was caused by the print system on the mac from failing to properly negotiate authentication in some way. But here is how I fixed it:

Step 1: Try to print something to this printer.  Then open the print queue for the printer, and click on the refresh (curly-arrow) icon to the right of the job name.  It should prompt you for your username and password for the print server, and then revert to "Hold for authentication".

This is really important. If you don't try to send a print job and have it stuck in "Hold for authentication" first, strange things can still happen after following the procedure below.  For me, I found that the print job would try to print, but the print queue would then immediately become paused, with the print job marked "Ready to print".  Very frustrating.

Step 2: Open a terminal window.  Everything we do from here will be done from in the terminal window.

Step 3: Find out the name of the printer on the command line by typing the following and pressing return:

lpstat -s

Step 4: Find the printer in question in the output. You will see that the names of the print queues have any fancy characters replaced with an underscore.  So your print queue name might have lots of underscores in it.  For example, my printer called "Tonsley : mono" appears in the output of lpstat -s below as "Tonsley___mono" (highlighted below):

$ lpstat -s
system default destination: Tonsley___colour__A3_in_tray_2_
device for GenericScanner: usb://00000000-0000-0000-FA13-000000000000
device for LaserJet_6MP__Jet_Direct_: socket://192.168.1.200/
device for Lexmark_6200_Series: usb://Lexmark/6200%20Series?serial=21B1280030008E5
device for Loopback: socket://127.0.0.1/
device for Samsung_CLP_310_Series: usb://Samsung/CLP-310%20Series?serial=149RBAFZ400869Z
device for Samsung_CLP_315_Series___alfred: dnssd://Samsung%20CLP-315%20Series%20%40%20alfred._ipp._tcp.local.
device for Samsung_ML_1640_Series: usb://Samsung/ML-1640%20Series?serial=3511BAFS501610N.
device for Tonsley___colour__A3_in_tray_2_: smb://tonsprint.isd.ad.flinders.edu.au/mdf-colour

device for Tonsley___mono: smb://tonsprint.isd.ad.flinders.edu.au/mfd-bw
$

Step 5: Force the mac to use username,password authentication for this printer by typing the following command (but don't forget to change the printer name from Tonsley___mono to the name of your print queue that you obtained in the previous step).  

sudo lpadmin -p Tonlsey___mono -o auth-info-required=username,password

When you hit return after typing this command you will be asked for your mac password.  Type it in.

Step 6: Attempt to print using the printer.  It should now work.  If it doesn't try deleting the printer and following the sequence again.  If the print queue keeps pausing itself and saying the print job is "ready to print", read the important note on step 1.

If this information helps you, please consider donating to http://servalproject.org.

48 comments:

  1. After all else failed, this worked for me. Thanks!!

    ReplyDelete
  2. Username: CHB (exactly as it is)
    Computer Name: CHB-PC (exactly as it is)
    Printer Name: Canon LBP3500 (exactly as it is)

    Tried the following variations in preferences as well as CUPS 2.1.0, but nothing works:

    smb://chb:************@chb-pc/Canon%20LBP3500

    smb://workgroup;chb:************@chb-pc/Canon%20LBP3500

    smb://chb-pc/Canon%20LBP3500

    smb://chb/chb-pc/Canon%20LBP3500

    During hold for authentication, tried guest/guest and the actual username/password returned with the following error messages: 'Connection refused', upon selecting print Test Page, 'Connecting to Printer' and then 'Ready to Print', etc.

    Have the up-to-date CAPT drivers installed from the Canon website. Even upgraded my OS X to El Capitan but still no luck.

    ReplyDelete
  3. This was very helpful, thank you very much!

    ReplyDelete
  4. I have a space and a coma in my password and I think it's making this command fail. How can I escape them ?

    ReplyDelete
    Replies
    1. Easiest solution I can think of is to change your password to not have the space. The comma shouldn't hurt anything.

      Delete
  5. This comment has been removed by the author.

    ReplyDelete
  6. Thank you! When all else failed, this works for me! And best solution I think.

    ReplyDelete

  7. Hi - unfortunately not working. How do I go back and remove that it askes for password?

    ReplyDelete
  8. Tried all this and variants - still not luck. Still Hold for Authentication. so irritating

    ReplyDelete
  9. same for me. it does not work. i think it's related with the smb not working in elcapitan anymore or because of a combination of elcapitan+win10... sucking....

    ReplyDelete
  10. anyway also on my other old macbook with snowleopard it is not working

    ReplyDelete
  11. This absolutely fixed my problem, thanks!

    ReplyDelete
  12. After having tried almost everything, this solved my problem! THANK YOU!

    ReplyDelete
  13. I receive:

    lpadmin: Unknown argument "auth-info-required=username,password".
    250SSDNPRs-Mac-mini:~ 250ssdnpr$

    ReplyDelete
    Replies
    1. Hello,

      Did you have the -o in front of it? Please copy paste the whole command and output all in one go, so that I can take a better look.

      Paul.

      Delete
    2. i get the same error----> lpadmin: Unknown argument "auth-info-required=username,password".
      here is all of the command and output:
      Last login: Thu Nov 24 10:32:26 on console
      Georges-MBP:~ evans$ lpstat -s
      system default destination: Evans_Home_Printer
      device for Evans_Home_Printer: smb://daddy/Evans%20Home%20Printer
      Georges-MBP:~ evans$ sudo lpadmin -p Evans_Home_Printer -o auth-info-required=username,password
      Password:
      lpadmin: Unknown argument “auth-info-required=username,password”.
      Georges-MBP:~ evans$

      Delete
  14. Hi Paul,

    I tried all above step, I found key icon (locked), so i couldn't entering my password.

    ReplyDelete
  15. Thanks for the post which I attempted but still did not resolve the issue.
    After some time, I eventually found that the problem is related to the protocol that the printer uses. So when adding the printer make sure you select Line Printer Daemon (LPD)

    ReplyDelete
  16. Thanks for the above... still not able to solve the problem I'm having with a wifi HP envy 5660 printer I just bought. HP is telling me it's a Mac problem.

    Quick question - I am running El Capitan. If I ran the script as described above, can I "undo" it to get the system back to the initial config so that I can continue with alternative approaches? Or if I reset the Printing System through the Printer & Scanner section of System Preference - will that take care of things?

    ReplyDelete
    Replies
    1. I think I answered my own question... but wanted to share my issue and how I solved it if anyone else runs into the same problem.

      I am using an iMac purchased in 2016 running El Capitan and purchased a wifi HP Envy 5660 printer. I installed the printer on my wifi network and the HP utility/drivers on my iMac. Was able to see/install the printer fine, scanned a picture, even printed a test page from the HP utility program. However, when I went to print from Word (or any other application) a dialogue box prompting me to input a user name and password. The user name field was pre-populated with “guest”. I have no idea what profile this was looking for, so I simply typed in the password for the user account that I was logged into my Mac with (has Administrator rights). I didn’t get an error, but in the print queue, there was a “Hold for Authentication” notification the job just sat there. I pressed the “refresh” button, and the dialogue box prompting for a user name and password popped up again. This time, I used the user name (and password) for the profile I was logged in under. No error message, but the job hung up again with the “Hold for Authentication” notification.

      Then I found this thread. I used [lpstat –s] to identify the printer and used the following command to set it to the admin user/password:

      sudo lpadmin -p (printer_name) -o auth-info-required=username,password

      I tried to print again, this time using my mac login/pwd, but same thing – Hold for Authentication.

      So, I uninstalled my printer and reinstalled it. Instead of setting it up as an AirPrint (Bonjour) printer, I set it up as an IP-based printer. I didn’t use the Generic Post Script driver (which was the default), but selected the HP driver. Typed in the [sudo] command from above, and unfortunately same result – dialogue box where no combination of user name and password seems to work. So I tired one more thing… I had read one another sudo thread that you can set the “authorization” switch to “none” instead of “username/password”. Setting to “username/password” refers you to the login credentials that you’re are logging in with, setting it to “none” should theoretically not require any security validation, right? Well, it worked! Here’s the command I used:

      sudo lpadmin -p (printer_name) -o auth-info-required=none

      One more time… install printer as IP, use manufacturer driver, use [sudo] command, but set auth-info-required=none.

      This appears to be a security bug with El Capitan… in a large networked situation (school or office) it makes sense. But when you are only going to use the computer at home and have a secure wifi network, it seems like overkill. I hope Apple/HP figure this one out in future updates!

      Delete
  17. For me the problem was on the side of the Win10 PC.

    There is a long and a short username. My long Microsoft username is my email address e.g.
    first name.lastname@yahoo.com.

    This username together with the password works when initially installing the printer on Mac OSX.

    When printing, I got into the 'Hold' state and then by reloading was asked to put in my user credentials. So, I repeated this and the steps detailed above.

    Nothing changed.

    I then went on the Windows 10 PC into the command prompt (Start Menu, type "cmd").

    Then on the command prompt type:

    echo %username%

    And your username will be returned. In my case this is a shortened version of the long email address e.g. firstna - not very intuitive.

    Then on my Mac when reloading the print job, I just replace the long username with the short username and everything works.

    ReplyDelete
    Replies
    1. This made it work after hours of trying basically everything else! Thank you sir, such a simple solution!

      Delete
    2. OMG!!!!
      You beautiful beautiful person!!! This was what did it for me. Username is different to the actual login details. Oddly my username was the same as my User file.

      Delete
  18. This is what finally worked for me. Thank you. The short username and NOT the microsoft account with my full email address.

    ReplyDelete
  19. This worked for me:
    1. Send anything to print. Open your Keychain Access.app and delete the entry for the print queue in question (it's going to be the name of your printer).
    2. Go to the printer, and where's says "Hold for authentication" press on the REFRESH icon and use this:
    User: guest
    Pass: guest

    You are going to be able to print, and is not going to "hold" anymore in the future.

    ReplyDelete
  20. I met this problem when I changed my password. The network printer was then no longer functioning, always "Ho d for authentication". The solution is to manually connect to server where your network printer is located, such as smb://, then it will request your username and password. Fill it with updated password resolves the problem.

    ReplyDelete
  21. this solved the problem for me. I am using mac osx 10.12, and i am relying on a windows server 2008r2 print server. this issue does not occur for all my printers, and all my macbook pros. Its intermittent across my environment. but once i applied this change, it worked flawlessly.

    ReplyDelete
  22. I tried all suggestions given here to overcome the 'Hold for Authentication' message whilst trying to print from macOS Sierra (10.12.5) to a Lexmark CX317dn colour printer.

    The ONLY thing that resolved the issue, was removing the printer and manually creating it as an IP printer with the Line Printer Daemon (LPD) protocol setting.

    That solved it immediately.

    ReplyDelete
  23. No doesn't work. I did the critical part about refreshing exactly. Went to terminal and everything worked. Tried to print then looped back for check for authentication. Reviewed again all instructions carefully...same thing. Prior to this I deleted all HP 8710. Your method changed nothing...check mate.

    ReplyDelete
  24. It turned out that my Key Chain was storing my old password. I updated the password corresponding to the printer, and problem solved.

    ReplyDelete
  25. THANK YOU!!! i love people taking the time to share the solution to a problem they know other people will encounter too... saved me a lot of time!

    ReplyDelete
  26. Tried and it worked perfectly. Thank you.

    ReplyDelete
  27. Thanks. This resolved my issues!!!

    ReplyDelete
  28. For me, after testing for weeks in vain, LPD immediately printed without asking for credentials. I installed Advanced > LPD/LPR Host or Printer > lpd://[server-name]/[sharename] and could immediately print the test page. No entry turned up in the KeyChain. The file sharing still works under SMB with its KeyChain entry as before. The client is an MBA with OS X Yosemite 10.10.5, the server - over WiFi - a PC with Windows 10 version 1803 (17134.885), the printer - over USB at the server - a Canon PIXMA iP3000. Driver is the CUPS+Guntenprint v5.2.9 .

    ReplyDelete
  29. Thanks so much!! This fixed my impossible problem

    ReplyDelete