FSA script from Steve Allen and Parallels Desktop

Thursday, June 04 2009 @ 10:50 AM BST

Contributed by: Admin

Are you using the fsa (find ssh agent) script from Steve Allen on your Mac ? Be careful with Parallels Desktop: apply this little patch to avoid annoying trouble when opening a Terminal session…

The FSA script written by Steve Allen (available here) is great to automate ssh-agent handling.

But it scans /tmp for ssh sockets without any depth limit. It's fine for most situation but the trouble with Parallels Desktop is that sometimes it mounts some virtual machine's volume in /tmp.

The immediate consequence is that execution of the fsa script embedded in a .bashrc or any other Terminal session's startup script will take "forever" to complete...

The simple fix is to change:

agentsocks=`find /tmp/ -user $LOGNAME -type s -name "*agent*" -print 2>/dev/null`

agentsocks=`find /tmp/ -maxdepth 2 -user $LOGNAME -type s -name "*agent*" -print 2>/dev/null`