tramp-devel
[Top][All Lists]
Advanced

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

Re: ad-hoc multi-hop editing of remote files


From: Michael Albinus
Subject: Re: ad-hoc multi-hop editing of remote files
Date: Thu, 20 Oct 2011 12:57:24 +0200
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.90 (gnu/linux)

Chris Withers <address@hidden> writes:

> Hi Michael,

Hi Chris,

> To pick up from your email above:
>
>  +-----------+      +------------+
>  |           | ---> | transit@   |--+
>  | you@      | ssh  +------------+  | sudo
>  |           |      | user@      |<-+
>  +-----------+      +------------+
>    localhost          remotehost
>
> How do I set up proxies such that I can do the above process but where
> none of 'transit', 'user' or 'remotehost' are hard coded in a config
> file?
>
> I really want to be able to use a path such as:
>
> /address@hidden:sudo:user:/some/file
>
> How do I do that? What do I need in the proxies list?

`tramp-default-proxies-alist' allows Lisp forms for all three items of
an entry. For the proxy item, you could do something like

(defun my-tramp-ad-hoc-proxy ()
  "Ask interactively for a proxy host."
  (read-file-name "Proxy host: "))

(add-to-list 'tramp-default-proxies-alist
             '("remote-host-exp" "remote-user-exp" (my-tramp-ad-hoc-proxy)))

Now you could open "C-x C-f /sudo:address@hidden". It will ask for the
proxy host, where you enter "/ssh:address@hidden:". After providing
the passwords, you are in.

(There seems to be an error in Tramp, 'cause it asks twice for the
proxy. Just apply RET for the second prompt. Will check and fix).

"remote-host-exp" shall match "remotehost", and "remote-user-exp" shall
match "user" but not "transit".

This sounds a little bit complex, but it isn't, because you can use
minibuffer's history for all the file names.

Maybe I shall add support in Tramp for this ad-hoc configuration. At
least it shall be documented.

> cheers,
>
> Chris
>
> PS: In trying to find out about this, I wanted to see if any
> development had been done that would help, which sprouted more
> questions:
>
> - is http://cvs.savannah.gnu.org/viewvc/tramp/?root=tramp where tramp
> is maintained?

Yes.

> - is
> http://cvs.savannah.gnu.org/viewvc/tramp/ChangeLog?root=tramp&view=markup
> the correct change log to be looking at? I hope not, since it doesn't
> mention either proxies arriving or multi: going away...

For the Lisp code, you shall use
http://cvs.savannah.gnu.org/viewvc/tramp/lisp/ChangeLog?root=tramp&view=markup

Best regards, Michael.



reply via email to

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