From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Bob Proulx Newsgroups: gmane.emacs.help Subject: Re: I'am root user, but 'emacs /etc/sudoers' still report Buffer is read-only: # in modeline Date: Wed, 29 Apr 2015 02:25:54 -0600 Message-ID: <20150429021820820823302@bob.proulx.com> References: <819c0a76-13fb-4d38-baa3-8ca429e8cf31@googlegroups.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1430298309 16808 80.91.229.3 (29 Apr 2015 09:05:09 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 29 Apr 2015 09:05:09 +0000 (UTC) Cc: help-gnu-emacs@gnu.org To: Show Dont Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Apr 29 11:05:04 2015 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1YnNvQ-0007xK-5h for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Apr 2015 11:05:00 +0200 Original-Received: from localhost ([::1]:37872 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnNvP-0001nL-Fm for geh-help-gnu-emacs@m.gmane.org; Wed, 29 Apr 2015 05:04:59 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:43732) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnNuX-0000Lc-Rc for help-gnu-emacs@gnu.org; Wed, 29 Apr 2015 05:04:10 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1YnNuT-0003uE-RB for help-gnu-emacs@gnu.org; Wed, 29 Apr 2015 05:04:05 -0400 Original-Received: from joseki.proulx.com ([216.17.153.58]:57240) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1YnNJc-000576-06 for help-gnu-emacs@gnu.org; Wed, 29 Apr 2015 04:25:56 -0400 Original-Received: from hysteria.proulx.com (hysteria.proulx.com [192.168.230.119]) by joseki.proulx.com (Postfix) with ESMTP id 186C121236; Wed, 29 Apr 2015 02:25:55 -0600 (MDT) Original-Received: by hysteria.proulx.com (Postfix, from userid 1000) id CE6DB2DC42; Wed, 29 Apr 2015 02:25:54 -0600 (MDT) Mail-Followup-To: Show Dont , help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: <819c0a76-13fb-4d38-baa3-8ca429e8cf31@googlegroups.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 216.17.153.58 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:104069 Archived-At: 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