help-gnu-emacs
[Top][All Lists]
Advanced

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

Re: remote file editing over ssh with emacs 22.3.1 on Windows


From: Anselm Helbig
Subject: Re: remote file editing over ssh with emacs 22.3.1 on Windows
Date: Sun, 10 May 2009 10:43:30 +0200
User-agent: SEMI/1.14.6 (Maruoka) FLIM/1.14.8 (Shijō) APEL/10.7 Emacs/22.3 (i686-pc-linux-gnu) MULE/5.0 (SAKAKI)

At Sat, 09 May 2009 19:05:50 +0100,
Chris Withers <chris@simplistix.co.uk> wrote:
> 
> Peter Dyballa wrote:
> > Once you're root on that system you don't really need to, 
> 
> Yes, it's root I want to sudo to.
> 
> None of the servers I work with allow logging in as root.

There's a feature in TRAMP to do just that. This used to be called
"multi-hop" but now is configured with `tramp-default-proxies-alist';
the documentation is still under (info "(tramp) Multi-hops"). Here's
what I have in my .emacs to use it:

  (setq tramp-default-method "ssh")

  (eval-after-load "tramp"
    '(when (boundp 'tramp-default-proxies-alist)
           (add-to-list 'tramp-default-proxies-alist
                  '("\\`\\(.*\\.example\\.com\\|somehost\\.example\\.org\\)\\'"
                    "\\`root\\'"
                    "/ssh:%h:"))))

I set things like port and username In my .ssh/config:

  Host *.example.com
    User foo

  Host somehost.example.org
    User bar
    Port 666

Now I can do C-x C-f /sudo:www.example.com:/ <RET> and work on the
remote host as root. 

HTH, 

Anselm


-- 
Anselm Helbig 
mailto:anselm.helbig+news2009@googlemail.com


reply via email to

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