From owner-freebsd-stable@FreeBSD.ORG Thu Nov 23 09:16:31 2006 Return-Path: X-Original-To: freebsd-stable@FreeBSD.ORG Delivered-To: freebsd-stable@FreeBSD.ORG Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id A94B316A407 for ; Thu, 23 Nov 2006 09:16:31 +0000 (UTC) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (lurza.secnetix.de [83.120.8.8]) by mx1.FreeBSD.org (Postfix) with ESMTP id D17B843D55 for ; Thu, 23 Nov 2006 09:15:55 +0000 (GMT) (envelope-from olli@lurza.secnetix.de) Received: from lurza.secnetix.de (bixsto@localhost [127.0.0.1]) by lurza.secnetix.de (8.13.4/8.13.4) with ESMTP id kAN9GJXE082670; Thu, 23 Nov 2006 10:16:24 +0100 (CET) (envelope-from oliver.fromme@secnetix.de) Received: (from olli@localhost) by lurza.secnetix.de (8.13.4/8.13.1/Submit) id kAN9GJXe082669; Thu, 23 Nov 2006 10:16:19 +0100 (CET) (envelope-from olli) Date: Thu, 23 Nov 2006 10:16:19 +0100 (CET) Message-Id: <200611230916.kAN9GJXe082669@lurza.secnetix.de> From: Oliver Fromme To: freebsd-stable@FreeBSD.ORG, stefan.thurner@mb.tu-chemnitz.de In-Reply-To: X-Newsgroups: list.freebsd-stable User-Agent: tin/1.8.2-20060425 ("Shillay") (UNIX) (FreeBSD/4.11-STABLE (i386)) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-2.1.2 (lurza.secnetix.de [127.0.0.1]); Thu, 23 Nov 2006 10:16:24 +0100 (CET) Cc: Subject: Re: pam.d/sshd X-BeenThere: freebsd-stable@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: freebsd-stable@FreeBSD.ORG, stefan.thurner@mb.tu-chemnitz.de List-Id: Production branch of FreeBSD source code List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 23 Nov 2006 09:16:31 -0000 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"