Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!


Click here to return to the 'Create protected passwordless ssh logins - Part 3 of 3' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
Create protected passwordless ssh logins - Part 3 of 3
Authored by: jaysoffian on Mar 28, '06 07:37:48AM
Here's my current User LoginHook/LogoutHook. See part 1 for the current system LoginHook/LogoutHook which enables these. Save this snippet as UserHook, follow the instructions in the comments to install, then you can remove UserHook:

#!/bin/sh
#
# INSTALLATION INSTRUCTIONS:
# mkdir $HOME/Library/Hooks
# cp UserHook $HOME/Library/Hooks/LoginHook
# cp UserHook $HOME/Library/Hooks/LogoutHook
# chmod -R 755 $HOME/Library/Hooks
#
PATH=/usr/bin:/bin
export PATH

hook=`basename $0`
exec > "$HOME/Library/Logs/${hook}.log" 2>&1

LoginHook () {
	. $HOME/Library/Libexec/ssh-agent
	# give keychain time to unlock before calling ssh-add
	(sleep 2; $HOME/Library/Libexec/ssh-add) &
}

LogoutHook () {
	eval `$HOME/Library/Libexec/envx`
	/usr/bin/ssh-agent -k
}

$hook


[ Reply to This | # ]