[Top][All Lists]

[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: Sat, 26 Dec 2009 21:36:36 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.1.90 (gnu/linux)

Chris Withers <address@hidden> writes:

> Hi All,


> I'd like to use tramp to edit files on a remote host, but where I need
> to be root to edit the files in question.

This shall be possible with Tramp 2.1. Which version do you use? The
Tramp 2.1 manual describes your case, for example here:

> I did see some other instructions involving adding stuff to my local
> ssh config and then adding separate stuff in my .emacs file, but that
> seems an unreasonable amount of work to have to do for each and every
> server I ever want to edit a remote file on as root.
> What am I doing wrong and what should I be typing in?

If you do not want to add additional configuration to your .emacs, you
might use Emacs 23.1.90 (the pretest version of 23.2). Eshell does the
multi-hop configuration for you. Example:

     M-x eshell

This opens the eshell buffer.

     ~ $ cd /ssh:address@hidden:/

With this command, you go to the remote host as the user you want to use
in transfer.

     /ssh:address@hidden:/ $ sudo ls

Now Tramp configures silently the sudo command for you. From now on, you
can also open files like /sudo:thehost:/ etc.

> cheers,
> Chris

Best regards, Michael.

reply via email to

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