all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim X <timx@nospam.dev.null>
To: help-gnu-emacs@gnu.org
Subject: Re: remote file editing over ssh with emacs 22.3.1 on Windows
Date: Sun, 17 May 2009 11:59:14 +1000	[thread overview]
Message-ID: <87d4a87aml.fsf@lion.rapttech.com.au> (raw)
In-Reply-To: mailman.7270.1242493264.31690.help-gnu-emacs@gnu.org

Chris Withers <chris@simplistix.co.uk> writes:

> Peter Dyballa wrote:
>>
>> When you write this, at which protocols do you think? 
>
> SSH.
>
>> When it's every protocol, then the only chance is to SSH login as some
>> user, become superuser in that user's login shell, and then send GNU
>> Emacs as client to your local X server over SSH.
>
> I don't know what this means. I do know that most of the servers will not
> be running X of any description.
>
> cheers,
>

Let me just recap to make sure I understand the problem.

1. You use tramp to edit files remotely as a normal user
2. sometimes, you need to edit a remote file that requires root privs.
3. You cannot ssh to the remote host as root

There are two possible solutions I can think of. The first is a type of
tramp multi-hop connection method. i.e. from the manual

   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.  It is important to know that
the given method is applied on the host which has been reached so far.
`sudo -u root', applied on your local host, wouldn't be useful here.

For this to work, you would need to have sudo configured on the remote
host. As you have root access to edit files, you shold be able to do
this.

The second method involves taking advantage of X11. The remote servers
don't need full X11 support for this to work, though some X11 libs are
required. For an X11 connection, a lot depends on how you are
connected. Its ideal for a LAN, works OK for reasonably fast WANs, such
as DSL and can work over modem dialup at 56k (though in that case, you
would want to use one of the X11 compression protocols). For this method
to work, you enable X11 forwarding in the ssh configuration (see the ssh
manual). This option is often enabled by default on Linux systems. 

When you start a remote emacs, all the display stuff is handled by your
local X session. If your network speed is adequate, its just like
running emacs locally. 

However, a question I have to ask is how often do you really need to
edit files as root? At one time, I was responsible for maintaining a key
system on servers that were scattered all over the country. The company
I worked for had a very strict policy on root access. With only a small
amount of analysis, we found that we were able to reconfigure things so
that over 90% of what I needed to do could be done without root
access. Maybe you could do something similar? Its good practice to only
run things as root when they absolutely need those privs. Unfortunately,
there is a considerable frequency of systems where either through lazy
admins or lack of skill/knowledge, programs run as root when they don't
need to because admins don't have the knowledge, time or resources to
configure things otherwise. There are actualy only a few key reasons
things need to run as root - for example, binding to ports below
1024. Even in these cases, many well written programs will rn as root to
bind to the socket and then drop back to a less privileged user for
normal operation. 

Another solution is to use a different group and have the files owned by
that group (using the sticky bit on group directory permissions can
ensure any files created in that directory are in that group). Then, you
add that group to your user account and adjust the file permissions to
allow members of that group to edit the file. You then don't need root
authority to edit these files.

HTH

Tim




-- 
tcross (at) rapttech dot com dot au


  parent reply	other threads:[~2009-05-17  1:59 UTC|newest]

Thread overview: 42+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-07  8:48 remote file editing over ssh with emacs 22.3.1 on Windows Chris Withers
2009-05-07 18:27 ` Eli Zaretskii
2009-05-07 18:48   ` Ian Eure
2009-05-08 21:18     ` Chris Withers
2009-05-08 21:19       ` Ian Eure
2009-05-08 21:23         ` Chris Withers
2009-05-09  7:05       ` Eli Zaretskii
2009-05-09  8:49         ` Chris Withers
2009-05-09  9:27           ` Eli Zaretskii
2009-05-09 17:41             ` Chris Withers
2009-05-09 19:09               ` Eli Zaretskii
2009-05-10  8:37                 ` Chris Withers
2009-05-10 17:29                   ` Eli Zaretskii
2009-05-10 18:23                   ` Peter Dyballa
2009-05-16 16:57                     ` Chris Withers
     [not found]                 ` <mailman.6949.1241969740.31690.help-gnu-emacs@gnu.org>
2009-05-11 21:18                   ` Anselm Helbig
2009-05-16 16:59                     ` Chris Withers
2009-05-23 20:02                       ` Michael Albinus
2009-05-25 15:40                         ` Chris Withers
2009-05-26 20:50                           ` Michael Albinus
2009-05-30 12:26                             ` remote file editing over ssh with emacs 22.3.1 on Windows/Mac Chris Withers
2009-05-30 12:35                               ` Michael Albinus
2009-06-08 12:06                               ` remote editing of unix files over ssh with emacs 22.3.1 from Windows Chris Withers
2009-06-08 12:39                                 ` Michael Albinus
2009-06-08 12:58                                   ` Chris Withers
2009-06-08 13:08                                     ` Michael Albinus
2009-06-12 15:38                                       ` Chris Withers
2009-06-08 12:51                                 ` Peter Dyballa
     [not found]                     ` <mailman.7269.1242493182.31690.help-gnu-emacs@gnu.org>
2009-05-16 18:21                       ` remote file editing over ssh with emacs 22.3.1 on Windows Anselm Helbig
2009-05-25 15:44                         ` Chris Withers
2009-05-09 18:04           ` Peter Dyballa
2009-05-09 18:05             ` Chris Withers
2009-05-09 19:40               ` Peter Dyballa
2009-05-16 17:01                 ` Chris Withers
2009-05-16 18:26                   ` Peter Dyballa
     [not found]                 ` <mailman.7270.1242493264.31690.help-gnu-emacs@gnu.org>
2009-05-17  1:59                   ` Tim X [this message]
2009-05-25 15:50                     ` Chris Withers
     [not found]             ` <mailman.6908.1241895850.31690.help-gnu-emacs@gnu.org>
2009-05-10  8:43               ` Anselm Helbig
2009-05-10  8:50                 ` Richard Riley
2009-05-16 17:03                 ` Chris Withers
     [not found]                 ` <mailman.7271.1242493390.31690.help-gnu-emacs@gnu.org>
2009-05-16 17:54                   ` Anselm Helbig
2009-05-10  7:28           ` Reiner Steib

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87d4a87aml.fsf@lion.rapttech.com.au \
    --to=timx@nospam.dev.null \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.