unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
* plaintext yank from ~/.authinfo [DANGER]
@ 2021-10-07 11:50 Emanuel Berg via Users list for the GNU Emacs text editor
  2021-10-07 12:54 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 1 reply; 2+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-10-07 11:50 UTC (permalink / raw)
  To: help-gnu-emacs

First congrats to a very good looking authinfo-mode which
still only uses the basic font-lock faces! Don't know whenever
this font-lock appeared because I don't visit that file every
day but I don't think I've seen it before ...

I also like the obfuscated passwords that are made visible
when you put the cursor at them!

However when I for example go to the beginning of the first
line, set the mark, move to the end of line, and do
`kill-ring-save', then the password is still obfuscated.

Only when I after that yank it it is inserted in plaintext!

This can backfire I think ...

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: plaintext yank from ~/.authinfo [DANGER]
  2021-10-07 11:50 plaintext yank from ~/.authinfo [DANGER] Emanuel Berg via Users list for the GNU Emacs text editor
@ 2021-10-07 12:54 ` Emanuel Berg via Users list for the GNU Emacs text editor
  0 siblings, 0 replies; 2+ messages in thread
From: Emanuel Berg via Users list for the GNU Emacs text editor @ 2021-10-07 12:54 UTC (permalink / raw)
  To: help-gnu-emacs

> First congrats to a very good looking authinfo-mode [...]

Bonus info!

How to use the authfile to get password-free ssh-ing despite
the pubkeys scheme not being used ...

Put this in ~/.emacs.d/ssh-pass.el

(require 'auth-source)

(message (auth-source-pick-first-password
          :host "..."
          :user "...") )

machine ... login ... port ... password ...

(for host, state the machine; for user, the login. quotes are
used in the Elisp script but not in the authfile)

I have the port sunos-ssh which is defined as a Tramp method
[last]

Then use a shell function

#! /bin/zsh

mic () {
    local pass=$(emacs --batch --load ~/.emacs.d/ssh-pass.el 2>&1)
    sshpass -p $pass \
            ssh -o ServerAliveInterval=120 ${USER}@${HOST}
}

https://dataswamp.org/~incal/conf/.zsh/remote-mic

done :)

;;; -*- lexical-binding: t -*-
;;;
;;; this file:
;;;   http://user.it.uu.se/~embe8573/emacs-init/tramp-incal.el
;;;   https://dataswamp.org/~incal/emacs-init/tramp-incal.el

(require 'tramp)
(require 'tramp-sh)

(setq tramp-histfile-override nil)

(add-to-list 'tramp-methods
  '("sunos-ssh"
    (tramp-login-program       "ssh")
    (tramp-login-args        (("-l" "%u")
                              ("-p" "%p")
                              ("%c")
                              ("-e" "none")
                              ("-t" "-t")
                              ("%h")
                              ("\"/bin/sh -i\"") ))
    (tramp-async-args        (("-q")))
    (tramp-remote-shell        "/bin/sh")
    (tramp-remote-shell-login ("-l"))
    (tramp-remote-shell-args  ("-c")) ))

-- 
underground experts united
https://dataswamp.org/~incal




^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2021-10-07 12:54 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-07 11:50 plaintext yank from ~/.authinfo [DANGER] Emanuel Berg via Users list for the GNU Emacs text editor
2021-10-07 12:54 ` Emanuel Berg via Users list for the GNU Emacs text editor

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).