I use the handy app SSHKeychain on my OS X box, which handles my SSH agent for me in various useful ways. The only problem is that the environment doesn't get set up properly for things like cron (since SSHKeychain stores it's socket info in a .plist).
This little snipped enables me to do things like:
with-sshkeychain svk sync -a 2>&1 | mail -s svk-sync-all adrianh
in my crontab and still get a connection to the SSHKeychain run ssh-agent. Super.
#! /usr/local/bin/perl # with-sshkeychain SOME OTHER COMMAND use Mac::PropertyList; my $plist = Mac::PropertyList::parse_plist_file( "$ENV{ HOME }/.MacOSX/environment.plist" ) or die "cannot parse environment.plist\n"; $ENV{ SSH_AUTH_SOCK } = $plist->value( 'SSH_AUTH_SOCK' ) or die "no SSH_AUTH_SOCK\n"; exec( @ARGV );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Extract SSH_AUTH_SOCK from SSHKeychain (OS X)
by Fletch (Bishop) on Feb 06, 2007 at 15:30 UTC | |
by jasonk (Parson) on Feb 08, 2007 at 22:57 UTC | |
|
Re: Extract SSH_AUTH_SOCK from SSHKeychain (OS X)
by Anonymous Monk on Sep 27, 2007 at 21:12 UTC | |
|
Re: Extract SSH_AUTH_SOCK from SSHKeychain (OS X)
by jasonk (Parson) on Feb 08, 2007 at 22:40 UTC | |
by adrianh (Chancellor) on Feb 09, 2007 at 12:58 UTC |