tramp-devel
[Top][All Lists]
Advanced

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

Re: Using sudo with authinfo file.


From: Michael Albinus
Subject: Re: Using sudo with authinfo file.
Date: Wed, 18 May 2011 14:38:54 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

Michael Jacobson <address@hidden> writes:

> Michael, 

Hi Michael,

> I am loading emacs with an empty .emacs file except for the following
> function I have been using for testing:
> ---------
> (defun my-SSHelper-connect()
>   (interactive)
>   (add-to-list 'load-path "~/Downloads/tramp-2.2.1/lisp")
>   (require 'auth-source)
>   (setq auth-source-debug t)
>   (require 'tramp)
>   (setq tramp-verbose 6)
>   (setq tramp-default-method "ssh")
>   (setq auth-sources '((:source "/home/mike/Desktop/.authinfo" :host t
> :protocol t)))
>   (add-to-list 'tramp-default-proxies-alist
>     '("192.168.1.120" "\\`root\\'" "/ssh:address@hidden:"))
>   (find-file "/sudo:192.168.1.120:"))
> ---------
> Does this look correct to someone with a trained eye? =)

Thanks for the recipe (and thanks also to Ted for the auth-source hints).
Your settings are OK. Using them (slightly adapted), I could reproduce
the problem.

The following patch ought to solve it:

--8<---------------cut here---------------start------------->8---
*** /home/albinus/src/tramp/lisp/tramp.el.~1~   2011-05-17 13:23:47.121328000 
+0200
--- /home/albinus/src/tramp/lisp/tramp.el       2011-05-18 14:25:23.646194000 
+0200
***************
*** 3105,3112 ****
  connection buffer."
    ;; Preserve message for `progress-reporter'.
    (tramp-compat-with-temp-message ""
!     ;; Enable auth-source and password-cache.
!     (tramp-set-connection-property vec "first-password-request" t)
      (save-restriction
        (let (exit)
        (while (not exit)
--- 3105,3117 ----
  connection buffer."
    ;; Preserve message for `progress-reporter'.
    (tramp-compat-with-temp-message ""
!     ;; Enable auth-source and password-cache.  We must use
!     ;; tramp-current-* variables in case we have several hops.
!     (tramp-set-connection-property
!      (tramp-dissect-file-name
!       (tramp-make-tramp-file-name
!        tramp-current-method tramp-current-user tramp-current-host ""))
!      "first-password-request" t)
      (save-restriction
        (let (exit)
        (while (not exit)
--8<---------------cut here---------------end--------------->8---

> Thanks again for the help. 
>
> --Mike

Best regards, Michael.



reply via email to

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