Save Credentials When Printing With Active Directory From a Mac
In this article
Yes, you can save your Active Directory credentials when printing from a Mac by storing them in the macOS Keychain. This prevents the repeated "Enter your username and password" prompt that appears for secured printers on a domain network. The process involves configuring the print queue with your domain account and allowing the Keychain to remember the authentication.
Why the Mac Asks for Credentials
When a Mac joins an Active Directory domain (or connects to a print server that requires authentication), the print job must be authorized by the print server. macOS uses the Kerberos authentication protocol for this. If the Mac is bound to the domain and the user has a valid Kerberos ticket, the print server can verify the user without a password prompt. However, if the Mac is not domain-bound, or if the user's ticket has expired, macOS falls back to asking for a username and password. The Keychain can store these credentials so the prompt only appears once.
How to Save Credentials in the Keychain
Follow these steps to store your Active Directory credentials for a specific printer:
- Open System Settings (or System Preferences on older macOS) and go to Printers & Scanners.
- Click the + button to add a printer, or select an existing printer and click Options & Supplies.
- When the authentication dialog appears, type your domain username (e.g.,
DOMAIN\usernameorusername@domain.com) and password. - Before clicking OK, check the box that says "Remember this password in my keychain" (the exact wording may vary by macOS version).
- Click OK. The credentials are now stored in your login keychain.
If the checkbox is not visible, you can manually add the credential to the Keychain Access app: open Keychain Access (in /Applications/Utilities), click File > New Password Item, and enter the printer's URL or server address as the "Name", your username as the "Account", and your password as the "Password".
Using Kerberos to Avoid Prompts
If your Mac is bound to Active Directory, the cleanest solution is to rely on Kerberos. When you log in with your domain account, macOS automatically obtains a Kerberos ticket. As long as the ticket is valid (usually 10 hours), printing to a secured printer should not prompt for credentials. To check if you have a valid ticket, open Terminal and run klist. If no ticket is listed, you can renew it with kinit.
If the Mac is not domain-bound but you still need to print to a secured printer, you can use the kinit command to manually obtain a Kerberos ticket. This ticket will be used by the print system, and you will not be prompted again until it expires.
Common Problems and Fixes
- Credentials not saved: Ensure you checked the keychain box during the initial setup. If you missed it, delete the printer and re-add it.
- Keychain item is ignored: Sometimes the print system uses a different service name. Try adding a keychain item with the exact printer URL (e.g.,
smb://printserver/printername). - Kerberos ticket expired: Run
kinitin Terminal, or log out and back in to refresh the ticket. - Prompt appears for every job: This often happens when the printer is configured with a different authentication method (e.g., LDAP instead of Kerberos). Check the printer's driver settings.
- Keychain locked: If your login keychain is locked, the credentials won't be available. Unlock it by logging in or using the Keychain Access app.
Comparing Methods: Keychain vs. Kerberos
Storing credentials in the Keychain is straightforward and works even if the Mac is not domain-bound. However, it stores your password in an encrypted file, which is generally safe but not as seamless as Kerberos. Kerberos is more secure because it uses ticket-based authentication and does not store your password. The trade-off is that Kerberos requires the Mac to be properly bound to the domain and the user to have a valid ticket. For most users, the Keychain method is simpler and sufficient.
Security Considerations
When you save credentials in the Keychain, they are encrypted with your login password. If someone gains access to your user account, they could potentially retrieve the stored password. To mitigate this, ensure your Mac is protected with a strong login password and consider enabling FileVault. Also, be cautious when using a shared or public Mac—do not save credentials on such machines. For sensitive environments, prefer Kerberos or use a one-time password solution.
Alternatives to Saving Credentials
If you cannot or do not want to save credentials, you can:
- Use Secure Print if the printer supports it—you release the job with a PIN at the device.
- Ask your IT administrator to configure the printer to allow guest access or to use a shared service account.
- Use a third-party print management tool that integrates with Active Directory.
Frequently Asked Questions
Why does my Mac still ask for a password even after saving?
This can happen if the keychain item is not being used by the print system. Try removing the printer and re-adding it, making sure to check the "remember" box. Also verify that the keychain is unlocked and that you are using the correct username format (e.g., domain\user).
Can I save credentials for a printer on a different domain?
Yes, you can save credentials for any printer that requires authentication, regardless of the domain. Just enter the appropriate username and password. However, the printer must be reachable from your network.
Is it safe to store my domain password in the Keychain?
The Keychain is encrypted and is generally considered secure. However, it is only as safe as your login password. If your Mac is compromised, an attacker could potentially access the Keychain. Use a strong login password and enable FileVault to reduce this risk.
Does saving credentials work with AirPrint?
AirPrint printers typically do not require Active Directory credentials, so this is usually not an issue. If you are using an AirPrint printer that is connected to a domain, the same keychain method may apply, but it is less common.
How do I remove saved credentials for a printer?
Open Keychain Access, search for the printer's name or address, and delete the item. You can also go to Printers & Scanners, select the printer, and click Options & Supplies to see if there is a "Reset" or "Clear" button for credentials.