From: "Bruno Félix Rezende Ribeiro" <oitofelix@gnu.org>
To: Michael Albinus <michael.albinus@gmx.de>
Cc: "Bruno Félix Rezende Ribeiro" <oitofelix@gnu.org>, emacs-devel@gnu.org
Subject: Re: tramp-auto-auth.el --- TRAMP automatic authentication library
Date: Wed, 28 Aug 2019 20:50:15 -0300 [thread overview]
Message-ID: <87o9086ea0.fsf@oitofelix.com> (raw)
In-Reply-To: <87woeyudc0.fsf@gmx.de> (Michael Albinus's message of "Tue, 27 Aug 2019 12:12:15 +0200")
[-- Attachment #1: Type: text/plain, Size: 2384 bytes --]
Hello Michael and other GNU Emacs developers,
Thanks for your reply.
Michael Albinus <michael.albinus@gmx.de> writes:
> Frankly, I'm not enthusiastic adding cleartext passwords into
> Tramp. This has all the security flaws you know, and is good for
> problems. At least in core Tramp it shouldn't be propagated.
Please, find attached the implementation of tramp-auto-auth.el using
exclusively the auth-source library.
I did as you suggested except that I didn’t add a new keyword nor made
any change to auth-source.el.
Quoting from the commentary section:
When a TRAMP prompt is encountered, ‘tramp-auto-auth-mode’ queries
the alist ‘tramp-auto-auth-alist’ for the auth-source spec value
whose regexp key matches the correspondent TRAMP path. This spec
is then used to query the auth-source library for a presumably
phony entry exclusively dedicated to the whole class of TRAMP
paths matching that regexp.
To make use of the automatic authentication feature, on the Lisp
side the variable ‘tramp-auto-auth-alist’ must be customized to
hold the path regexps and their respective auth-source specs, and
then ‘tramp-auto-auth-mode’ must be enabled. For example:
---- ~/.emacs.el -------------------------------------------------
(require 'tramp-auto-auth)
(add-to-list
'tramp-auto-auth-alist
'("root@10\\.0\\." .
(:host "Funny-Machines" :user "root" :port "ssh")))
(tramp-auto-auth-mode)
------------------------------------------------------------------
After this, just put the respective sacred secret in an
authentication source supported by auth-source library. For
instance:
---- ~/.authinfo.gpg ---------------------------------------------
machine Funny-Machines login root password "$r00tP#sWD!" port ssh
------------------------------------------------------------------
In case you are feeling lazy or the secret is not so secret (nor so
sacred) -- or for any reason you need to do it all from Lisp --
it’s enough to:
(auth-source-remember '(:host "Funny-Machines" :user "root" :port "ssh")
'((:secret "$r00tP#sWD!")))
And happy TRAMPing!
Is this feature in this form suitable for inclusion in the TRAMP
standard distribution?
Please, let me know what you think.
[-- Attachment #2: tramp-auto-auth.el --]
[-- Type: application/emacs-lisp, Size: 6584 bytes --]
[-- Attachment #3: Type: text/plain, Size: 257 bytes --]
--
88888 FFFFF Bruno Félix Rezende Ribeiro (oitofelix) [0x28D618AF]
8 8 F http://oitofelix.freeshell.org/
88888 FFFF mailto:oitofelix@gnu.org
8 8 F irc://chat.freenode.org/oitofelix
88888 F xmpp://oitofelix@riseup.net
next prev parent reply other threads:[~2019-08-28 23:50 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-08-23 2:08 tramp-auto-auth.el --- TRAMP automatic authentication library Bruno Félix Rezende Ribeiro
2019-08-27 10:12 ` Michael Albinus
2019-08-28 23:50 ` Bruno Félix Rezende Ribeiro [this message]
2019-08-29 11:04 ` Michael Albinus
2019-08-31 23:29 ` Bruno Félix Rezende Ribeiro
2019-09-01 9:59 ` Michael Albinus
2019-09-01 12:53 ` Stefan Monnier
2019-09-01 15:35 ` Michael Albinus
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87o9086ea0.fsf@oitofelix.com \
--to=oitofelix@gnu.org \
--cc=emacs-devel@gnu.org \
--cc=michael.albinus@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).