[Top][All Lists]

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

Re: Why proxies?

From: Michael Albinus
Subject: Re: Why proxies?
Date: Thu, 31 Aug 2006 08:08:50 +0200
User-agent: Gnus/5.110006 (No Gnus v0.6) Emacs/22.0.50 (gnu/linux)

Kirk Strauser <address@hidden> writes:

> Another alternative that would fix 99% of the problems I have would be to
> find a way to allow the proxy value to incorporate parts of the host (and
> maybe user) values.  For example, I want to write a ruleset like:
> (add-to-list 'tramp-default-proxies-alist
>    '(".my.domain" nil "/ssh:address@hidden:"))
> (add-to-list 'tramp-default-proxies-alist
>    '(nil "kirk" nil))
> so that "/sudo:address@hidden" will first ssh to randomhost,
> then use sudo to change users.  From what I can tell, I currently have to
> write a rule for each and every machine before I can connect to it for the
> first time.  Would something like that be workable?

That's simple. I've committed a corresponding patch to CVS. The info
page of multi-hops has been extended by this:

   PROXY can contain the patterns `%h' or `%u'.  These patterns are
replaced by the strings matching HOST or USER, respectively.

   If you, for example, wants to work as `root' on hosts in the
domain `your.domain', but login as `root' is disabled for non-local
access, you might add the following rule:

     (add-to-list 'tramp-default-proxies-alist
                  '("\\.your\\.domain\\'" "\\`root\\'" "/ssh:%h:"))

   Opening `/sudo:randomhost.your.domain:' would connect first
`randomhost.your.domain' via `ssh' under your account name, and
perform `sudo -u root' on that host afterwards.

Best regards, Michael.

reply via email to

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