[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: tramp (2.0.58-pre); no user/password prompt on freebsd
From: |
Paolo Vanni M. Veñegas |
Subject: |
Re: tramp (2.0.58-pre); no user/password prompt on freebsd |
Date: |
Thu, 09 Jul 2009 19:22:43 +0800 |
User-agent: |
Gnus/5.11 (Gnus v5.11) Emacs/22.3 (berkeley-unix) |
Michael Albinus <address@hidden> writes:
> "Paolo Vanni M. Veñegas" <address@hidden> writes:
>
>> I am trying to connect remotely from emacs on a freebsd box to another
>> freebsd box (platform may be relevant). Using tramp with ido-mode does
>> not work at all, as when I type in /ssh:, it immediately tries to
>> connect to the host "ssh". When I set ssh as default method, with
>> ido-mode on it as soon as I enter /user@ it assumes I am looking for a
>> directory.
>
> According to the ChangeLogs, coexistence between Tramp and ido was
> implemented in November 2007. So it cannot work in Emacs 22. Try Emacs
> 23, which might be released on July 22nd (according to recent
> announcements).
Thanks, will do.
> Tramp sends passwords only if they are cached. This caching does not
> survive an Emacs session.
I did some digging around on my own. It seems that had something to do
with the way ange-ftp kept its accounts. I already tried
tramp-clear-passwd, as well as restarting emacs, to no avail. Since the
problem that tramp was skipping the password prompt, I checked the code
and found this:
(defun tramp-read-passwd (user host prompt)
"Read a password from user (compat function).
Invokes `password-read' if available, `read-passwd' else."
(if (functionp 'password-read)
(let* ((key (concat (or user (user-login-name)) "@" host))
(password (apply #'password-read (list prompt key))))
(apply #'password-cache-add (list key password))
password)
(read-passwd prompt)))
(functionp 'password-read) was evaluating to t, so I assumed it was
password-read that was broken. I replaced that condition with (if nil...
so it used read-passwd instead, and the prompt worked again. I didn't
bother finding out why password-read was not working.
Also, I found a much more elegant solution anyway. Just use key-based
SSH logins and ssh-agent, which emacs/tramp happily use from env when
spawning ssh. :)
Thanks for the prompt reply though!
--
pmv