tramp-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Password issue using sudo through ssh


From: Michael Albinus
Subject: Re: Password issue using sudo through ssh
Date: Tue, 01 Sep 2015 11:40:09 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/25.0.50 (gnu/linux)

Brice Waegenire <address@hidden> writes:

Hi Brice,

> Thanks for the advice to crosscheck, my password showed up. I replaced
> it by *MY PASSWORD IN CLEAR*.
>
> 10:51:46.380007 tramp-send-command (6) # exec env SHELL=/bin/sh sudo -u root 
> -s -H -p Password:
> 10:51:51.487483 tramp-process-actions (6) # 
> exec env SHELL=/bin/sh sudo -u root -s -H -p Password:  
> [32me[32mx[32me[32mc[39m [32me[32mn[32mv[39m SHELL=/bin/sh sudo -u root -s -H 
> -p Password:
> # *MY PASSWORD IN CLEAR*

Wow! Your remote host has echoed the command "exec env ... -p Password:". 
Tramp has detected "Password:" at the end of the line, and thought it
is your password prompt. So it sends the password, which is wrong.

Try the following patch (line numbers might be different), and start
Emacs again from scratch. This shall solve the problem, hopefully.

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp-sh.el.~master~   2015-09-01 
11:37:13.024404152 +0200
--- /home/albinus/src/tramp/lisp/tramp-sh.el    2015-09-01 11:28:44.954654949 
+0200
***************
*** 288,294 ****
  (add-to-list 'tramp-methods
    '("sudo"
      (tramp-login-program        "sudo")
!     (tramp-login-args           (("-u" "%u") ("-s") ("-H") ("-p" 
"Password:")))
      ;; Local $SHELL could be a nasty one, like zsh or fish.  Let's override 
it.
      (tramp-login-env            (("SHELL") ("/bin/sh")))
      (tramp-remote-shell         "/bin/sh")
--- 288,297 ----
  (add-to-list 'tramp-methods
    '("sudo"
      (tramp-login-program        "sudo")
!     ;; The password template must not be the last argument.
!     ;; Otherwise, it could be interpreted as password prompt if the
!     ;; remote host echoes the command.
!     (tramp-login-args           (("-p" "Password:") ("-u" "%u") ("-s") 
("-H")))
      ;; Local $SHELL could be a nasty one, like zsh or fish.  Let's override 
it.
      (tramp-login-env            (("SHELL") ("/bin/sh")))
      (tramp-remote-shell         "/bin/sh")
--8<---------------cut here---------------end--------------->8---

Best regards, Michael.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]