From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Julien Cubizolles Newsgroups: gmane.emacs.help Subject: Emacs daemon as a systemd service can't use ssh-agent Date: Sun, 30 Oct 2016 00:45:15 +0200 Message-ID: <87a8dmdbb8.fsf@free.fr> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Trace: blaine.gmane.org 1477814493 7207 195.159.176.226 (30 Oct 2016 08:01:33 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 30 Oct 2016 08:01:33 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.0.50 (gnu/linux) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Sun Oct 30 09:01:29 2016 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1c0l3T-0000w2-OQ for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Oct 2016 09:01:23 +0100 Original-Received: from localhost ([::1]:57349 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0l3W-0007zU-FR for geh-help-gnu-emacs@m.gmane.org; Sun, 30 Oct 2016 04:01:26 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48923) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1c0cO8-0001E2-Mg for help-gnu-emacs@gnu.org; Sat, 29 Oct 2016 18:46:09 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1c0cO5-0006xa-Jt for help-gnu-emacs@gnu.org; Sat, 29 Oct 2016 18:46:08 -0400 Original-Received: from [195.159.176.226] (port=56129 helo=blaine.gmane.org) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1c0cO5-0006xM-D6 for help-gnu-emacs@gnu.org; Sat, 29 Oct 2016 18:46:05 -0400 Original-Received: from list by blaine.gmane.org with local (Exim 4.84_2) (envelope-from ) id 1c0cNY-0000JP-Lu for help-gnu-emacs@gnu.org; Sun, 30 Oct 2016 00:45:32 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 21 Original-X-Complaints-To: usenet@blaine.gmane.org Cancel-Lock: sha1:eEwQmC8jZCXlRApIjaeLwAfL8/M= X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 195.159.176.226 X-Mailman-Approved-At: Sun, 30 Oct 2016 04:00:34 -0400 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.21 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" Xref: news.gmane.org gmane.emacs.help:111634 Archived-At: I'm starting Emacs as a daemon with a systemd user service, as per http://www.wikemacs.org/wiki/Emacs_server. It's mostly working fine but it doesn't seem to be able to use the ssh-agent running in the graphical session (I'm running gnome-shell): I get asked for my password every time as use a tramp connection. For some reason, gpg-agent doesn't have this problem: the first time I access an encrypted file, I get a dialog box asking for the passphrase but I don't have to enter it the subsequent times. One workaround I found it to use keychain to manage both gpg-agent and ssh-agent once the session is started and then use the keychain-environment.el to import the relevant environment variables. Emacs can then use ssh-agent. I'm however looking for a way to have my display manager (gdm) ask for the ssh and gpg passphrases at login and somehow make Emacs aware of them. How would you do it ? Julien.