ssh-agent handling

http://stackoverflow.com/a/112618