From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Tim X Newsgroups: gmane.emacs.help Subject: Re: Doing Linux admin work with Emacs Date: Thu, 14 Oct 2010 08:20:06 +1100 Organization: Unlimited download news at news.astraweb.com Message-ID: <87hbgpx01l.fsf@rapttech.com.au> References: <70fd06bf-4566-4274-9381-ee569700cabd@n40g2000vbb.googlegroups.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: dough.gmane.org 1291891454 1258 80.91.229.12 (9 Dec 2010 10:44:14 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 9 Dec 2010 10:44:14 +0000 (UTC) To: help-gnu-emacs@gnu.org Original-X-From: help-gnu-emacs-bounces+geh-help-gnu-emacs=m.gmane.org@gnu.org Thu Dec 09 11:44:10 2010 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.69) (envelope-from ) id 1PQdyp-0005xr-GR for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 11:44:10 +0100 Original-Received: from localhost ([127.0.0.1]:60980 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PQdyo-000811-2q for geh-help-gnu-emacs@m.gmane.org; Thu, 09 Dec 2010 05:44:06 -0500 Original-Path: usenet.stanford.edu!news.kjsl.com!news.alt.net!news-xfer.nntp.sonic.net!news.astraweb.com!border1.newsrouter.astraweb.com!not-for-mail Original-Newsgroups: gnu.emacs.help User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux) Cancel-Lock: sha1:gEX6m+qN9iPXAXIzxqmQGmQIsGE= Original-Lines: 57 Original-NNTP-Posting-Host: 12266cb3.news.astraweb.com Original-X-Trace: DXC=DAbTUO@2; 9H5\iVS6:P; :IL?0kYOcDh@JN7:H2`MmAUCU\YKDg@=BbC]G; 2>V^?kWCCAkl5c@XgkNVY1a>R5HV0NKj0bO`:=i3A Original-Xref: usenet.stanford.edu gnu.emacs.help:181761 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:76965 Archived-At: bebop52 writes: > Hello, > I think it's very nice to use emacs as "operating system" on top of > linux (Ubuntu Lucid 10.0.4 in my case). Especially dired is a > wonderful tool in my eyes. > > When I start Gnu Emacs 23.1.1 with "myUser$ sudo emacs" (with myUser > having admin rights) I can do everything I want, since Emacs acts as > root-user. Which is very comfortable, but has a few negative side- > effects: > > a) It means any new files/folders have owner and group 'root', but > should have owner 'myUser' and group 'myUsersGroup'. > > b) Furthermore, many programs put some files or folders in the active > users home directory during installation. For example maven puts its > repo under ~/.m2/repository/. My maven repository ended up under > root/.m2/repository/, because emacs acted as root user, so that was > the home directory. > > c) Isn't it very dangerous to do websurfing with w3m after starting > emacs with "sudo emacs"? Any malware could potentially act as root > user, if there are security wholes in w3m or emacs. But when I do > admin work, I always have to google some stuff and end up in the web. > > On the other hand, if I do "myUser$ emacs" (with myUser having admin > rights), without sudo, I can do admin work from the eshell using sudo > when necessary. But what about dired, for example? How can I give > emacs dired temporarily and in a controlled way admin rights (via > sudo) while running it as 'myUser' and not as 'root'? > > I'm still looking for a decent workflow that enables me to open emacs > in the morning via xterm or gnome and stay in emacs all day, do the > admin/filesystem stuff as admin (but often via dired, if possible), > work as a standard user with sudo rights when writing or programming, > and surfing the web as a limited user without admin rights and with > little security risks. And being able to swich effortlessly between > the different roles. > > Thanks for any help from wiser minds to a relative beginner in the > linux/emacs universe > t. > The solution I believe your looking for is tramp. Run emacs as a normal user without any special admin privs. Then, when you need to edit a file as root, use the tramp sudo or su methods to open the file (see the tramp manual). Running emacs as root is a very bad idea. Tim -- tcross (at) rapttech dot com dot au