pam.d/sshd
Oliver Fromme
olli at lurza.secnetix.de
Thu Nov 23 01:16:31 PST 2006
Stefan Thurner wrote:
> I would like to activate ssh-agent automatically if I login
> via ssh.
As far as I know there is no mechanism to start ssh-agent
automatically. (Someone please correct me if I'm wrong.)
Personally I have the following snippet in my ~/.zshrc
which starts ssh-agents if it isn't already running.
It also works if the home directory is shared across
multiple machines.
if [[ $EUID -ne 0 ]]; then
AGENTFILE="${HOME}/.ssh-agent.${HOST%%.*}"
if [[ -r "$AGENTFILE" ]]; then
source "$AGENTFILE"
else
export SSH_AGENT_PID=$$
fi
if [[ -z "$SSH_AGENT_PID" ]] \
|| ! ps -p "$SSH_AGENT_PID" | grep -q ssh-agent; then
ssh-agent >! "$AGENTFILE"
source "$AGENTFILE"
fi
unset AGENTFILE
fi
Best regards
Oliver
--
Oliver Fromme, secnetix GmbH & Co. KG, Marktplatz 29, 85567 Grafing
Dienstleistungen mit Schwerpunkt FreeBSD: http://www.secnetix.de/bsd
Any opinions expressed in this message may be personal to the author
and may not necessarily reflect the opinions of secnetix in any way.
"Life is short (You need Python)"
-- Bruce Eckel, ANSI C++ Comitee member, author
of "Thinking in C++" and "Thinking in Java"
More information about the freebsd-stable
mailing list