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 Jacobson
Subject: Re: Using sudo with authinfo file.
Date: Tue, 17 May 2011 22:49:46 -0500


Ted,
> That node doesn't mention `auth-source-debug' which can be customized to
> t.  The first debugging step should be to set it to t and look at
> *Messages*.  You'll see exactly what auth-source is looking for
> in the authinfo file.

Interesting. I have always at this set to t, but did not see any output until I commented out the call to "with-parsed-tramp-file-name" in the "tramp-read-passwd" function of tramp.el. Of course when I comment out that call, everything works, so the auth source debug output is not helpful.

 
Michael,
That's always a good start to look for. My guess is, that Tramp might be
looking for "localhost" or something like this not contained in
.authinfo, if you are connecting via a "/sudo::/path" file name. You
might check your settings for `tramp-default-host' or
`tramp-default-proxies-alist'. Or you use explicit user name and host
name for test purposes, like "/sudo:address@hidden:/path".


Here is the output of the *Messages* buffer with tramp verbosity at 6, and auth-source-debut set to t:
---------------------
Tramp: Opening connection for address@hidden using sudo...
Tramp: Sending command `exec ssh -l mike  -e none 192.168.1.120'

Tramp: Waiting for prompts from remote shell
----------------------
At this point I am prompted for a password. (address@hidden).



Here is the same output with "with-parsed-tramp-file-name" commented out in the "tramp-read-passwd" function:
-----------------------
Tramp: Opening connection for address@hidden using sudo...
Tramp: Sending command `exec ssh -l mike  -e none 192.168.1.120'

Tramp: Waiting for prompts from remote shell
Tramp: Sending password
auth-source-user-or-password: get password for 192.168.1.120 (ssh)
auth-source-user-or-password: found (password)=SECRET for 192.168.1.120 (ssh)
Tramp: Sending command `exec ssh -l mike  -e none 192.168.1.120'
Tramp: Found remote shell prompt on `192.168.1.120'
Tramp: Sending command `exec sudo -u root -s -H -p Password:'

Tramp: Waiting for prompts from remote shell
Tramp: Sending command `exec sudo -u root -s -H -p Password:'
Tramp: Found remote shell prompt on `192.168.1.120'
Tramp: Opening connection for address@hidden using sudo...done
---------------------
This one is successful.



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 again for the help.

--Mike



reply via email to

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