Add .bashrc blurb for picking up agent info to SSH post.
[blog.git] / posts / SSH.mdwn
index 5d6ddffdee64dac68aa487878febc47905020c44..cd4006bc5535c9e3dcc4d8dfb0a233af284c307f 100644 (file)
@@ -33,7 +33,16 @@ about the agent with:
 
 I usually prime the SSH agent right after I log in (before running
 [[screen]] or `startx`) to that new terminals come up knowing about
-the agent.
+the agent.  You can also add something like:
+
+    SSH_INFO_FILE="/tmp/$(whoami)/.ssh/.ssh-agent-info-$(hostname)"
+    if [ -f "$SSH_INFO_FILE" ]; then
+        . "$SSH_INFO_FILE"
+    fi
+
+to your `~/.bashrc` (or equivalent shell initialization file), after
+which spawning shells will automatically pick up SSH agent
+information.
 
 Grabbing a ssh-agent by process ID
 ----------------------------------