मैं अपने किचेन में विभिन्न पासवर्ड (जैसे रिमोट ईमेल सर्वर) स्टोर कर रहा हूं। कमांड लाइन से, जब स्थानीय रूप से लॉग इन किया जाता है, तो मैं इन्हें पुनः प्राप्त कर सकता हूं:
security unlock-keychain ~/Library/Keychains/login.keychain
<enter password>
security find-internet-password -s smtp.gmail.com -a foo@gmail.com
<dumps keychain attributes, not including password>
security find-internet-password -s smtp.gmail.com -a foo@gmail.com -g
<dumps keychain attributes, including password>
हालाँकि, दूर से चलाने पर परिणाम प्राप्त नहीं किया जा सकता (बॉक्स में कहीं और से ssh'ing):
security unlock-keychain ~/Library/Keychains/login.keychain
<enter password>
security find-internet-password -s smtp.gmail.com -a foo@gmail.com
<dumps keychain attributes, not including password>
security find-internet-password -s smtp.gmail.com -a foo@gmail.com -g
<nothing printed, to stdout or stderr>
इसके अलावा, अंतिम कमांड का रिटर्न मान (-g) 36 है।
मैंने setएक स्थानीय लॉगिन से आउटपुट डंप किया है और इसकी तुलना रिमोट से की है, और लापता पर्यावरण चर हैं:
Apple_PubSub_Socket_Render
GPG_AGENT_INFO
SECURITYSESSIONID
TERM_PROGRAM
TERM_PROGRAM_VERSION
TERM_SESSION_ID
XPC_FLAGS
XPC_SERVICE_NAME
मुझे किसकी याद आ रही है? मेरे पास SSH_AUTH_SOCKएक वैध मान है (से लौटा ssh-agent)।

