sous debian, ssh-agent utiliise dbus et on s'habitue vite au confort de ne devoir tapper son mdp une seule fois par jour. Sous windows, c'est idem lorsqu'on lance puuty-agent au demarrage de la session.
sous les autres os, il faut faire ca a la mimine. en attendant mieux, voilà de quoi donner a manger a .profile, .zshenv et .xsession:
# does $SSH_AGENT_PID exists and is it
# correctly set ?
# use it as boolean ...
# exemple: ssh_agent_right_pid && echo ok
# tested: dash, zsh
ssh_agent_right_pid () {
# if pid exists, there are 2 lines
# so the second read returns 0
local a b
[ -n "$SSH_AGENT_PID" ] &&
ps -p $SSH_AGENT_PID | {
read a
read b
}
}
# if ssh-agent command is available on the system
# tries to launch and load a key
# in .xsession, source it before exec yourwm
if which ssh-agent > /dev/null; then
ssh_agent_right_pid || source ~/.today_agent > /dev/null
ssh_agent_right_pid || {
ssh-agent > ~/.today_agent
source ~/.today_agent > /dev/null
# open it in a term if you use this script in your .xesssion
ssh-add
}
ssh_agent_right_pid || {
echo "can't launch agent" >&2
false
}
fi
Keychain
J'utilise keychain c'est sympa :) :
http://www.gentoo.org/proj/en/keychain/
Poster un nouveau commentaire