tramp-devel
[Top][All Lists]
Advanced

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

Re: editing a file on a remote host as root


From: Michael Albinus
Subject: Re: editing a file on a remote host as root
Date: Sun, 27 Dec 2009 09:15:34 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux)

Chris Withers <address@hidden> writes:

> (add-to-list 'tramp-default-proxies-alist
>              '(nil "\\`root\\'" "/ssh:%h:"))
> (add-to-list 'tramp-default-proxies-alist
>              '((regexp-quote (system-name)) nil nil))
>
> I can now successful open things like /sudo::/etc/ to sudo open local
> files, and I can open remote files under my username with, eg,
> /address@hidden:~/, but if I try and open /sudo:thehost: I still get:
>
> ad-Orig-error: Cannot connect to different host `thehost' with `su'
> connection method

This works for me. Could you, please, tell which emacs-version and
tramp-version you are using? I'm a little bit surprised by the "Cannot
connect to different host" error message, this sounds like Tramp
2.0. You need Tramp 2.1 for the recipe I gave you.

> /address@hidden:~/
> /sudo:thehost:/

This shall work with the settings above.

> /sudo:address@hidden:/

For this, you need another rule, like

(add-to-list 'tramp-default-proxies-alist
              '(nil "\\`different_user_to_my_local_user\\'" "/ssh:%h:"))

> Chris

Best regards, Michael.




reply via email to

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