From: Bob Proulx <bob@proulx.com>
To: Show Dont <byboating@gmail.com>
Cc: help-gnu-emacs@gnu.org
Subject: Re: I'am root user, but 'emacs /etc/sudoers' still report Buffer is read-only: #<buffer sudoers> in modeline
Date: Wed, 29 Apr 2015 02:25:54 -0600 [thread overview]
Message-ID: <20150429021820820823302@bob.proulx.com> (raw)
In-Reply-To: <819c0a76-13fb-4d38-baa3-8ca429e8cf31@googlegroups.com>
Show Dont wrote:
> I want to edit /etc/sudoers for add 'git ALL=(ALL:ALL) ALL' in it. I
> am ready the root user, but emacs still can not edit the
> /etc/sudoers.
Use C-q C-x to toggle read-only status. It starts off read-only
because the file permissions are read-only. If you are the root
superuser then you can toggle the buffer read-only status and then
edit the file anyway and override the file permissions on save and
write the file anyway.
Here is the documentation.
https://www.gnu.org/software/emacs/manual/html_node/emacs/Misc-Buffer.html
Specifically for the suders file it is a good idea to use the
'visudo' command to edit that file. It will make a copy of the file
for editing and then will validate the syntax before saving. It
prevents typos and accidents breaking the sudo configuration, which
might prevent a sudo only user from having sudo to fix the problem.
'visudo' respects the EDITOR variable and will invoke emacs as the
editor if EDITOR is set to emacs.
I highly recommend using the visudo command for editing the
/etc/sudoers file. It will make a writable copy and therefore you
won't need to toggle the read-only status.
Bob
next prev parent reply other threads:[~2015-04-29 8:25 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-29 6:27 I'am root user, but 'emacs /etc/sudoers' still report Buffer is read-only: #<buffer sudoers> in modeline Show Dont
2015-04-29 8:25 ` Bob Proulx [this message]
2015-04-29 8:36 ` tomas
2015-04-29 9:24 ` Alex Kost
2015-04-29 10:33 ` tomas
[not found] ` <mailman.1889.1430298251.904.help-gnu-emacs@gnu.org>
2015-04-29 20:08 ` Emanuel Berg
2015-04-29 20:29 ` Emanuel Berg
2015-04-30 21:36 ` Bob Proulx
[not found] ` <mailman.2062.1430429791.904.help-gnu-emacs@gnu.org>
2015-05-01 1:23 ` Emanuel Berg
2015-05-01 2:31 ` Emanuel Berg
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=20150429021820820823302@bob.proulx.com \
--to=bob@proulx.com \
--cc=byboating@gmail.com \
--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.