From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: jadamson@partners.org (Joel J. Adamson) Newsgroups: gmane.emacs.help Subject: Re: SU commands from Emacs Date: Fri, 17 Aug 2007 16:28:51 -0400 Organization: Harvard University Message-ID: <87eji1hpmk.fsf@W0053328.mgh.harvard.edu> References: <878x8ahxho.fsf@W0053328.mgh.harvard.edu> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: sea.gmane.org 1187383405 13414 80.91.229.12 (17 Aug 2007 20:43:25 GMT) X-Complaints-To: usenet@sea.gmane.org NNTP-Posting-Date: Fri, 17 Aug 2007 20:43:25 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Fri Aug 17 22:43:22 2007 Return-path: Envelope-to: geh-help-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.50) id 1IM8fC-0007B1-02 for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Aug 2007 22:43:22 +0200 Original-Received: from localhost ([127.0.0.1] helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1IM8fB-0004fL-Fr for geh-help-gnu-emacs@m.gmane.org; Fri, 17 Aug 2007 16:43:21 -0400 Original-Path: shelby.stanford.edu!newsfeed.stanford.edu!news.tele.dk!news.tele.dk!small.news.tele.dk!uio.no!quimby.gnus.org!news.ccs.neu.edu!news.dfci.harvard.edu!news.harvard.edu!not-for-mail Original-Newsgroups: gnu.emacs.help Original-Lines: 39 Original-NNTP-Posting-Host: w0053328.mgh.harvard.edu Original-X-Trace: plato.harvard.edu 1187382585 27670 132.183.29.121 (17 Aug 2007 20:29:45 GMT) Original-X-Complaints-To: news@plato.harvard.edu Original-NNTP-Posting-Date: Fri, 17 Aug 2007 20:29:45 +0000 (UTC) User-Agent: Gnus/5.11 (Gnus v5.11) Emacs/22.1 (gnu/linux) Cancel-Lock: sha1:/WYheEbJCKKfNbD9TASFXqbXfPc= Original-Xref: shelby.stanford.edu gnu.emacs.help:151094 X-BeenThere: help-gnu-emacs@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Users list for the GNU Emacs text editor List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Errors-To: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.help:46667 Archived-At: David Hansen writes: > On Fri, 17 Aug 2007 13:38:59 -0400 Joel J. Adamson wrote: > >> The one remaining problem is executing shell commands that need root >> permission. I can use Dired and edit files with "/su::" tramp-mode, >> however sometimes I just need to execute a command. I have sudo >> installed on Slackware Linux 12.0, but the password prompt does not >> come up properly. > > I use > > (defun root-shell (&optional arg) > (interactive "P") > (let ((explicit-shell-file-name "sudo")) > (shell (if arg > (generate-new-buffer-name "*root shell*") > "*root shell*")) > ;; change this to your roots home directory > (setq default-directory "/root/"))) Thanks David, that's slightly more convenient than entering a terminal emulator *and then* entering "su..." --- but I mean something different. I'd like to run root commands straight from an editor window, for example Dired. Deleting files is fine, I just do dired with "/su::" and then run the regular dired commands. Sometimes I want to do a command that requires root privileges. Joel -- Joel J. Adamson Biostatistician Pediatric Psychopharmacology Research Unit Massachusetts General Hospital Boston, MA 02114 (617) 643-1432 (303) 880-3109