From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 17203 invoked by alias); 16 Jan 2013 17:35:40 -0000 Mailing-List: contact zsh-users-help@zsh.org; run by ezmlm Precedence: bulk X-No-Archive: yes List-Id: Zsh Users List List-Post: List-Help: X-Seq: 17572 Received: (qmail 11301 invoked from network); 16 Jan 2013 17:35:38 -0000 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on f.primenet.com.au X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.2 Received-SPF: none (ns1.primenet.com.au: domain at closedmail.com does not designate permitted sender hosts) From: Bart Schaefer Message-id: <130116093514.ZM19656@torch.brasslantern.com> Date: Wed, 16 Jan 2013 09:35:14 -0800 In-reply-to: <20130116065951.GA2992@lp-shahaf.local> Comments: In reply to Daniel Shahaf "Backgrounding part of 'ssh-agent $cmd'" (Jan 16, 8:59am) References: <20130116065951.GA2992@lp-shahaf.local> X-Mailer: OpenZMail Classic (0.9.2 24April2005) To: zsh-users@zsh.org Subject: Re: Backgrounding part of 'ssh-agent $cmd' MIME-version: 1.0 Content-type: text/plain; charset=us-ascii On Jan 16, 8:59am, Daniel Shahaf wrote: } Subject: Backgrounding part of 'ssh-agent $cmd' } } More specifically, my workflow involves establishing several 'ssh -MNf' } connections every morning Are you running this on an Xorg desktop? Some Xorg distributions set up ssh-agent directly under the session manager so all applications on the desktop use the same agent. Unless you specifically need to run a separate agent for this, you might check whether one is already available. I source a file from my .zlogin that looks like this (details elided): (( SSH_AGENT_PID )) || return 0 [[ $(ssh-add -L) = *"no identities"* ]] || return 0 ssh-add ... The ssh-add command in this setup is clever enough to invoke zenity or gdialog or the equivalent to pop up a window for the password. Have you tried something like ssh-add ~/.ssh/foo.id_rsa >& .ssh-add-errors to see if it finds some other way to prompt you? If that works, then you can just background the entire foo_ssh_preseed call, whether or not you already have an ssh-agent for the desktop session.