all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Michael Albinus <michael.albinus@gmx.de>
To: "Bruno Félix Rezende Ribeiro" <oitofelix@gnu.org>
Cc: emacs-devel@gnu.org
Subject: Re: tramp-auto-auth.el --- TRAMP automatic authentication library
Date: Tue, 27 Aug 2019 12:12:15 +0200	[thread overview]
Message-ID: <87woeyudc0.fsf@gmx.de> (raw)
In-Reply-To: <877e74skek.fsf@oitofelix.com> ("Bruno Félix Rezende Ribeiro"'s message of "Thu, 22 Aug 2019 23:08:51 -0300")

Bruno Félix Rezende Ribeiro <oitofelix@gnu.org> writes:

> Hello Emacs developers,

Hi Bruno,

> Please, find attached ‘tramp-auto-auth.el’.  Quoting from its commentary
> header section:
>
>   This library provides ‘tramp-auto-auth-mode’: a global minor mode
>   whose purpose is to automatically feed TRAMP sub-processes with
>   passwords for paths matching regexps.  This is useful in situations
>   where interactive user input is not desirable or feasible.  For
>   instance, in sub-nets with large number of hosts or whose hosts have
>   dynamic IPs assigned to them.  In those cases it’s not practical to
>   query passwords using the ‘auth-source’ library, since this would
>   require each host to be listed explicitly and immutably in a Netrc
>   file.  Another scenario where this mode is useful are non-interactive
>   Emacs sessions (like those used for batch processing or by evaluating
>   ‘:async’ Org Babel source blocks) in which it’s impossible for the
>   user to answer a password-asking prompt.

Thanks for this.

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.

> This library has proved extremely useful for my work using Emacs to
> access remote machines in the aforementioned conditions and whose
> authentication policies I couldn’t change.  For quite some time, I’ve
> searched extensively for ways of accomplishing the same task with a
> practical setup, to no avail.  Perhaps you could comment on alternative
> approaches you had experience with but I failed to contemplate.

Emacs has the password infrastructure auth-source.el and
password-cache.el, which do their best to avoid password related
problems. If they do not fit your needs, they shall be extended.

The best approach would be if auth-source would support regular
expressions for the declarations of items. Instead of applying declaring

     machine MYMACHINE login MYLOGINNAME password MYPASSWORD port MYPORT

one would declare something like

     machine-regexp REGEXP login MYLOGINNAME password MYPASSWORD port MYPORT

I have used the netrc syntax, and I have add a new keyword; but any
other backend shall work also. I've shortly scanned debbugs; there
doesn't exist (yet) a request to support regular expressions. Maybe you
write a bug report about?

Another approach could be to use different Tramp methods. You could
declare

     password MYPASSWORD port method1
     password OTHERPASSWORD port method2

In Tramp, you would declare new methods method1 and method2, derived
from (for example) ssh. Then you can open /method1:host:/path/to/file
for a host which uses MYPASSWORD, and you can open
/method2:otherhost:/path/to/file for a host which uses OTHERPASSWORD.

> Thanks in advance,
> Bruno

Best regards, Michael.



  reply	other threads:[~2019-08-27 10:12 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 [this message]
2019-08-28 23:50   ` Bruno Félix Rezende Ribeiro
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

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87woeyudc0.fsf@gmx.de \
    --to=michael.albinus@gmx.de \
    --cc=emacs-devel@gnu.org \
    --cc=oitofelix@gnu.org \
    /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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.