Make my password protected SSH key expire or timeout after a while
Note: in newer versions of OS X you must disable System Integrity Protection for this answer to work. (Thanks to @Dave Gregory and @Jaap for pointing this out.)

Open /System/Library/LaunchAgents/com.openssh.ssh-agent.plist (in older versions: org.openbsd.ssh-agent.plist) in a text editor. Replace:

&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;/usr/bin/ssh-agent&lt;/string&gt;
    &lt;string&gt;-l&lt;/string&gt;
&lt;/array&gt;


with:

&lt;key&gt;ProgramArguments&lt;/key&gt;
&lt;array&gt;
    &lt;string&gt;/usr/bin/ssh-agent&lt;/string&gt;
    &lt;string&gt;-l&lt;/string&gt;
    &lt;string&gt;-t&lt;/string&gt;
    &lt;string&gt;30m&lt;/string&gt;
&lt;/array&gt;


This will expire the key after 30 minutes.

Reboot. Wait, reboot?!? This isn't Windows! Yes, reboot.

Well, you can try to decipher the instructions for changing the setting on the fly, but good luck.