[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
doas method default user should be user-login-name
From: |
Sunil Nimmagadda |
Subject: |
doas method default user should be user-login-name |
Date: |
Sat, 02 Sep 2017 13:15:40 +0530 |
User-agent: |
mu4e 0.9.18; emacs 26.0.50 |
Hi,
doas(1) on the commandline while prompting for password displays
address@hidden, for example...
~$ doas ls
doas (address@hidden) password:
but tramp's doas method default username is set to "root" and the text
displayed while prompting for password is...
Password for /doas:address@hidden:
which confused me. doas(1) expects the user's password. The following
diff sets doas method's default user to user-login-name instead of
"root".
I was wondering if this a good approach to fix the prompt, thanks.
diff --git a/lisp/tramp-sh.el b/lisp/tramp-sh.el
index 85966f12..96192fea 100644
--- a/lisp/tramp-sh.el
+++ b/lisp/tramp-sh.el
@@ -405,7 +405,7 @@ The string is used in `tramp-methods'.")
;;;###tramp-autoload
(add-to-list 'tramp-default-user-alist
- `(,(concat "\\`" (regexp-opt '("su" "sudo" "doas" "ksu")) "\\'")
+ `(,(concat "\\`" (regexp-opt '("su" "sudo" "ksu")) "\\'")
nil "root"))
;; Do not add "ssh" based methods, otherwise ~/.ssh/config would be ignored.
;; Do not add "plink" based methods, they ask interactively for the user.
@@ -414,7 +414,7 @@ The string is used in `tramp-methods'.")
`(,(concat
"\\`"
(regexp-opt
- '("rcp" "remcp" "rsh" "telnet" "nc" "krlogin" "fcp"))
+ '("rcp" "remcp" "rsh" "telnet" "nc" "krlogin" "fcp" "doas"))
"\\'")
nil ,(user-login-name)))
- doas method default user should be user-login-name,
Sunil Nimmagadda <=