Posted on 01-13-2017 01:08 PM
Hello, I am trying to create a login keychain item to be able to connect to an SMB printer. The printer is shared with "Everyone" and no password is required, but on the Macs we are still prompted for a password. We can just enter "Guest" for the user ID with no password and get connected, but that is just a bit too much for most of my users to be able to handle.
So far I have got this for the command-line:
security add-generic-password -a Guest -D "network password" -w "" -s "smb://print-01.ccsd93.com" -C genp -l "BW_Printer" -A
I know I am going to need to track down the full paths to replace the -A with -T "NetAuthSysAgent" -T "NetAuthAgent.app" -T "NetAuth", but right now I still don't think the account is getting created correctly. When I add the account manually via the dialog box the icon in Keychain Access is the blue-@ sign. When I create the account via the command-line the icon in Keychain Access is the pencil. SO I think I am using some wrong settings.
Any clue as to what I need to modify to get this working?
Thanks, Tim
Posted on 01-13-2017 02:10 PM
So this is what I do. security add-internet-password -D 'network password' -a USERNAME -w 'PASSWORD' -r 'smb ' -s print-01.ccsd93.com -l NetworkPrinters -T /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthSysAgent -T /System/Library/CoreServices/NetAuthAgent.app/Contents/MacOS/NetAuthAgent -T /system/library/privateframeworks/netauth.framework/versions/a/netauth -U /dev/null 2>&1 &
I have a username and password specified, but you can try it without the password. I also use add-internet-password for the network printers. I hope this helps.
Posted on 01-14-2017 08:25 AM
Thanks so much. I'll take a look at this when I'm back in the office next week.