all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Tim X <timx@spamto.devnul.com>
Subject: Re: Edit file write protected by superuser rigths
Date: 09 Aug 2005 18:02:12 +1000	[thread overview]
Message-ID: <87iryfbksb.fsf@tiger.rapttech.com.au> (raw)
In-Reply-To: mailman.3054.1123534713.20277.help-gnu-emacs@gnu.org

Armin Goralczyk <agoralczyk@gmail.com> writes:

> Hi
> How can I edit a file that is write protected by superuser rights? I
> can visit the file but it is read-only. I removed read-only
> protection by C-x C-q (toggle-read-only) but after editing I cannot
> save the file. Minibuffer says:
> File fink.conf is write-protected; try to save anyway? (yes or no) ->
> yes
> Doing chmod: operation not permitted
> 
> So how can I save the file provided that I can have superuser rights?
> 
> Thank you
> Regards
> Armin
> 

Well, first of all you need to somehow let emacs know you have
superuser rights. The obvious way to do this is start emacs while
logged in as the super user. However, this is a bad way of working. 

The easiest alternative is to use tramp and define a "sudo"
method. You will need to have sudo configured for this to work. The
idea is outlined in detail in the tramp manual (at least it use to be
last time I read it some time back). 

If you don't want to go to this extent, the other solution is to copy
the file to your home directory, edit it and then copy it back after
su'ing to root or using sudo. 

Note that I'm assuming your running under some form of unix or linux
and that your not logged in as the su when starting emacs. If you are
not running on unix/linux, then I cannot help.

Tim

-- 
Tim Cross
The e-mail address on this message is FALSE (obviously!). My real e-mail is
to a company in Australia called rapttech and my login is tcross - if you 
really need to send mail, you should be able to work it out!

       reply	other threads:[~2005-08-09  8:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <mailman.3054.1123534713.20277.help-gnu-emacs@gnu.org>
2005-08-09  8:02 ` Tim X [this message]
2005-08-08 20:47 Edit file write protected by superuser rigths Armin Goralczyk
2005-08-08 21:35 ` Peter Dyballa
2005-08-09 17:58   ` Armin Goralczyk
2005-08-09 18:31     ` Peter Dyballa
2005-08-09 18:59       ` Armin Goralczyk
     [not found]     ` <mailman.3145.1123612751.20277.help-gnu-emacs@gnu.org>
2005-08-25  0:53       ` David Combs
2005-08-25  8:50         ` Peter Dyballa
     [not found] ` <mailman.3062.1123538567.20277.help-gnu-emacs@gnu.org>
2005-08-08 22:02   ` William Daffer
2005-08-08 22:47 ` Sebastian Luque

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=87iryfbksb.fsf@tiger.rapttech.com.au \
    --to=timx@spamto.devnul.com \
    /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.