help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Doing Linux admin work with Emacs


From: Tim X
Subject: Re: Doing Linux admin work with Emacs
Date: Wed, 08 Dec 2010 15:31:46 -0000
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

bebop52 <gruenderteam.berlin@googlemail.com> 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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]