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: Chris Withers
Subject: Re: editing a file on a remote host as root
Date: Sat, 26 Dec 2009 22:03:30 +0000
User-agent: Thunderbird 2.0.0.23 (Macintosh/20090812)

Michael Albinus wrote:
This shall be possible with Tramp 2.1. Which version do you use?

How do I find out what version I'm using?
If my version is too old, how do I upgrade?

The
Tramp 2.1 manual describes your case, for example here:

http://www.gnu.org/software/tramp/#Multi_002dhops

Okay, so after reading that, I added the following to my .emacs file:

;; shell-prompt-pattern stuff
(require 'tramp)

(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

If you do not want to add additional configuration to your .emacs,

I don't mind adding something like the above, I just don't want to have to add stuff *and* add ssh config in my .ssh file for each host I want to connect to. The holy grail for me is to be able to use any of the following:

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

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk




reply via email to

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