From mboxrd@z Thu Jan 1 00:00:00 1970 Path: main.gmane.org!not-for-mail From: Micha Feigin Newsgroups: gmane.emacs.help Subject: Re: Running emacs as root Date: Fri, 9 Jan 2004 01:36:14 +0200 Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Message-ID: <20040108233614.GA21718@luna.mooo.com> References: <8765fnr1ti.fsf@home.se> NNTP-Posting-Host: deer.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1073664751 32511 80.91.224.253 (9 Jan 2004 16:12:31 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 9 Jan 2004 16:12:31 +0000 (UTC) Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Jan 09 17:12:28 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 1AezFA-0000gh-00 for ; Fri, 09 Jan 2004 17:12:27 +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 1Aekyo-00062N-IG for geh-help-gnu-emacs@m.gmane.org; Thu, 08 Jan 2004 19:58:26 -0500 Original-Received: from list by monty-python.gnu.org with tmda-scanned (Exim 4.24) id 1AekwX-0005dH-18 for help-gnu-emacs@gnu.org; Thu, 08 Jan 2004 19:56:05 -0500 Original-Received: from mail by monty-python.gnu.org with spam-scanned (Exim 4.24) id 1Aekvr-0005Pf-Vn for help-gnu-emacs@gnu.org; Thu, 08 Jan 2004 19:55:56 -0500 Original-Received: from [132.66.16.11] (helo=post.tau.ac.il) by monty-python.gnu.org with esmtp (Exim 4.24) id 1AekfB-0001a6-0i for help-gnu-emacs@gnu.org; Thu, 08 Jan 2004 19:38:09 -0500 Original-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by post.tau.ac.il (Postfix) with ESMTP id 0C82047E25 for ; Fri, 9 Jan 2004 01:36:37 +0200 (IST) Original-Received: from post.tau.ac.il (localhost.localdomain [127.0.0.1]) by localhost.localdomain (VaMailArmor-2.0.1.16) id 13271-476AAAFC; Fri, 09 Jan 2004 01:36:37 +0200 Original-Received: from litshi.luna.local (unknown [62.219.140.142]) by post.tau.ac.il (Postfix) with ESMTP id CC05147E25 for ; Fri, 9 Jan 2004 01:36:36 +0200 (IST) Original-Received: from micha by litshi.luna.local with local (Exim 4.30) id 1AejhG-0005fe-Ha for help-gnu-emacs@gnu.org; Fri, 09 Jan 2004 01:36:14 +0200 Original-To: help-gnu-emacs@gnu.org Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.5.1+cvs20040105i X-AntiVirus: checked by Vexira MailArmor (version: 2.0.1.16; VAE: 6.23.0.2; VDF: 6.23.0.27; host: localhost) 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:15857 X-Report-Spam: http://spam.gmane.org/gmane.emacs.help:15857 On Wed, Jan 07, 2004 at 07:54:27PM -0800, Ted Weatherly wrote: > Is there a way to change my environment while executing a command? > You can append the environment setting on the commend line, for example = will run with = in its environment. > Henrik Enberg wrote in message news:<8765fnr1ti.fsf@home.se>... > > 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". > _______________________________________________ > Help-gnu-emacs mailing list > Help-gnu-emacs@gnu.org > http://mail.gnu.org/mailman/listinfo/help-gnu-emacs >