From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Michael Albinus Newsgroups: gmane.emacs.help Subject: Re: tramp and ssh-agent / ssh-add Date: Sun, 30 Mar 2008 13:12:25 +0200 Message-ID: <878x00a2jq.fsf@gmx.de> References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1206875487 11433 80.91.229.12 (30 Mar 2008 11:11:27 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Sun, 30 Mar 2008 11:11:27 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Roland Winkler Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Mar 30 13:11:58 2008 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1JfvS8-00077F-2a for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Mar 2008 13:11:56 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfvRW-00032k-3o for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Mar 2008 07:11:18 -0400 Original-Received: from mailman by lists.gnu.org with tmda-scanned (Exim 4.43) id 1JfvR4-0002zE-HU for help-gnu-emacs@gnu.org; Sun, 30 Mar 2008 07:10:50 -0400 Original-Received: from exim by lists.gnu.org with spam-scanned (Exim 4.43) id 1JfvR2-0002wF-Tg for help-gnu-emacs@gnu.org; Sun, 30 Mar 2008 07:10:50 -0400 Original-Received: from [199.232.76.173] (helo=monty-python.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1JfvR2-0002vo-GY for help-gnu-emacs@gnu.org; Sun, 30 Mar 2008 07:10:48 -0400 Original-Received: from mail.gmx.net ([213.165.64.20]) by monty-python.gnu.org with smtp (Exim 4.60) (envelope-from ) id 1JfvR2-0002kQ-2r for help-gnu-emacs@gnu.org; Sun, 30 Mar 2008 07:10:48 -0400 Original-Received: (qmail invoked by alias); 30 Mar 2008 11:10:46 -0000 Original-Received: from p57A23113.dip0.t-ipconnect.de (EHLO arthur.local) [87.162.49.19] by mail.gmx.net (mp033) with SMTP; 30 Mar 2008 13:10:46 +0200 X-Authenticated: #3708877 X-Provags-ID: V01U2FsdGVkX1/DBPdGDa/DmDUH/3QtVshnB+eG+GxBv5P0JUA0q4 BSNb7tVCCk6i+F In-Reply-To: (Roland Winkler's message of "Sun, 30 Mar 2008 01:53:23 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.0.60 (gnu/linux) X-Y-GMX-Trusted: 0 X-detected-kernel: by monty-python.gnu.org: Linux 2.6, seldom 2.4 (older, 4) X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:52827 Archived-At: Roland Winkler writes: Hi, > Usually when I have emacs running on a remote machine, I do this as > a subprocess of ssh-agent. Then when I establish ssh connections > via tramp, I want to make sure that I type my password only once via > ssh-add. What is the cleanest way to do that? Is there some support > from tramp for that? Right now, my home-made solution uses a > defadvice for tramp-open-connection-rsh, see the code below. > However, if tramp-open-connection-rsh is the right entry point for > what I want to do, it seems to me that a hook might be helpful. Or > am I missing something else? I wouldn't do it this way: - You advice tramp-open-connection-rsh, a function of Tramp 2.0. It doesn't exist anymore in Tramp 2.1, so you solution isn't future safe. - I believe that calling ssh-add on-the-fly is not the intended way. You should call it, before you run emacs "as a subprocess of ssh-agent" on the remote machine. - Tramp supports password caching on its own. Install password.el in your own lisp directory. You could download it from . Then you add the following line to your .emacs, after loading Tramp: (setq password-cache-expiry nil) > Thanks, > > Roland Best regards, Michael.