From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jorge.alfaro-murillo@yale.edu (Jorge A. Alfaro-Murillo) Newsgroups: gmane.emacs.help Subject: Re: tramp and ssh-key passphrase Date: Fri, 18 Mar 2016 16:21:11 -0400 Message-ID: <87oaaba66g.fsf@yale.edu> References: <877fhouggd.fsf@hornfels.zedat.fu-berlin.de> <87a8lvfufj.fsf@heimdali.yagibdah.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; format=flowed X-Trace: ger.gmane.org 1458332512 14208 80.91.229.3 (18 Mar 2016 20:21:52 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 18 Mar 2016 20:21:52 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Mar 18 21:21:43 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1ah0tz-0001YU-7c for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Mar 2016 21:21:43 +0100 Original-Received: from localhost ([::1]:46135 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ah0ty-0003cX-91 for geh-help-gnu-emacs@m.gmane.org; Fri, 18 Mar 2016 16:21:42 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:44781) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ah0th-0003Yl-Mg for help-gnu-emacs@gnu.org; Fri, 18 Mar 2016 16:21:26 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ah0td-0003Yh-Km for help-gnu-emacs@gnu.org; Fri, 18 Mar 2016 16:21:25 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:39181) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ah0td-0003YV-Eb for help-gnu-emacs@gnu.org; Fri, 18 Mar 2016 16:21:21 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1ah0tc-0001MJ-9Z for help-gnu-emacs@gnu.org; Fri, 18 Mar 2016 21:21:20 +0100 Original-Received: from 130.132.236.141 ([130.132.236.141]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Mar 2016 21:21:20 +0100 Original-Received: from jorge.alfaro-murillo by 130.132.236.141 with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Fri, 18 Mar 2016 21:21:20 +0100 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 56 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: 130.132.236.141 User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux) Cancel-Lock: sha1:bGR3rbxS7OPrto72xEjrIb2DGso= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:109625 Archived-At: lee writes: > "Loris Bennett" writes: >> >> Try setting up an SSH agent. That way you just have to enter >> the passphrase once per session. > > Thanks, I tried, and it only says > > ,---- | Could not add card ".ssh/[...]": agent refused operation > `---- You are supposed to have a key in your .ssh, if not do something like #+BEGIN_SRC shell cd ~/.ssh ssh-keygen -t rsa -b 4096 -o -a 100 #+END_SRC You would then have to copy the content of id_rsa.pub into ~/.ssh/authorized_keys of the machine you want to login onto. > when I try to add a key, so I killed it. The agent had been > started with > > ,---- | eval $(ssh-agent) `---- > > in my .xinitrc. > > This is awful because it requires me to exit the X session to > get the ssh-agent to work. I won't do much experimenting on > this ... You should only start the ssh-agent once per session, that is the whole point of it. Actually it should start automatically. You can try: #+BEGIN_SRC shell killall ssh-agent eval `ssh-agent -s` #+END_SRC Then do #+BEGIN_SRC shell ssh-add #+END_SRC right after you login. It will ask for the password of your id_rsa key, and then let you connect for the rest of your session. Best, -- Jorge.