Search code examples
macoscommand-lineterminalkeychain

Create internet-password and specify where field


I've been able to create an internet password but when opening the password in Keychain, I don't see the where field. Any ideas how to specify this?

security add-internet-password -a "foo" -s test.com -w "bar12345"

I've reviewed https://ss64.com/osx/security-internet.html, but unable to see how to specify the where field.


Solution

  • oh wait, just got it working myself...

    security add-internet-password -a "foo" -s test.com -w "bar12345" -r 'htps'

    If specifying -r htps, you specify the protocol which results in the entry being correctly created and the where field being populated as https://test.com. This wasn't too clear in and related searches I did.