How to force OSX to ask for ssh key passphrase each time?

Hi There,


Title says it all really - is there a way to force OSX to ask for a ssh passphrase each time it's accessed?


We haven't ticked the option to save passphrases into the keychain and require an extra level of security - is this possible?


Cheers


Ben

Posted on Oct 5, 2014 2:52 PM

Reply
19 replies

Sep 7, 2016 4:23 PM in response to cmscss

Unfortunately, El Capitan has come along and broken this solution:


1) You can no longer unload ssh-agent:

# launchctl unload /System/Library/LaunchAgents/org.openbsd.ssh-agent.plist

/System/Library/LaunchAgents/org.openbsd.ssh-agent.plist: Operation not permitted while System Integrity Protection is engaged
2) You can't edit the org.openbsd.ssh-agent.plist even as root, also because of SIP, so no way to add a timeout value to the storing of the key.

3) You can't disable it from starting due to the above.


Only thing I've been able to do is set a cron job to run 'ssh-add -D' every few minutes so any key that gets added to ssh-agent gets removed a few minutes later so I'll have to password decrypt it again on next use.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

How to force OSX to ask for ssh key passphrase each time?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.