From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Henrik Enberg Newsgroups: gmane.emacs.help Subject: Re: Running emacs as root Date: Wed, 07 Jan 2004 20:33:29 +0100 Organization: Le Petomane Appreciation Society Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <8765fnr1ti.fsf@home.se> References: NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1073504902 31287 80.91.224.253 (7 Jan 2004 19:48:22 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Wed, 7 Jan 2004 19:48:22 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Wed Jan 07 20:48:18 2004 Return-path: Original-Received: from monty-python.gnu.org ([199.232.76.173]) by deer.gmane.org with esmtp (Exim 3.35 #1 (Debian)) id 1AeJf7-0007a9-00 for ; Wed, 07 Jan 2004 20:48:18 +0100 Original-Received: from localhost ([127.0.0.1] helo=monty-python.gnu.org) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AeKaw-0000dw-LK for geh-help-gnu-emacs@m.gmane.org; Wed, 07 Jan 2004 15:48:02 -0500 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!fu-berlin.de!uni-berlin.de!h244n2fls32o1112.telia.COM!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 19 Original-NNTP-Posting-Host: h244n2fls32o1112.telia.com (213.65.65.244) Original-X-Trace: news.uni-berlin.de 1073504024 7492636 213.65.65.244 ([125297]) X-Now-Playing: Townes Van Zandt - Pancho and Lefty User-Agent: Gnus/5.1006 (Gnus v5.10.6) Emacs/21.3.50 (gnu/linux) Cancel-Lock: sha1:UBbBHLvSQG+Oz+xmrJyCgUgfibk= Original-Xref: shelby.stanford.edu gnu.emacs.help:119845 Original-To: help-gnu-emacs@gnu.org X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.2 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 Xref: main.gmane.org gmane.emacs.help:15788 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15788 tbonemp3@yahoo.com (Ted Weatherly) writes: > To run emacs as root, I normally 'su' then 'emacs'. I'd like to > create a script to simplify this. I try: > > sudo -u root /bin/sh -c "emacs" > > ...and I'm able to edit files as root. But when I run a shell within > emacs, my prompt displays as if I'm a regular user (i.e. it shows as > "/tmp> " but I want "/tmp# "). So it appears as if emacs is using the > .profile of the regular user. How do I fix this? sudo doesn't change your environment, you'd have to use su for that. > Perhaps there is a better way to launch emacs as root? I use tramp.el (see http://savannah.nongnu.org/projects/tramp/) to open files as root with sudo within the running emacs. When tramp is installed simply do "C-x f /sudo:root@localhost:/path/to/file".