LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 10-16-2010, 11:14 AM   #1
unixform
LQ Newbie
 
Registered: Jul 2009
Posts: 14

Rep: Reputation: 1
Question VLC as root in Gnome


Hello, everyone!

It is very well known that running VLC as root in KDE is easy: in the menu editor, in the Advanced tab, you check "Run as a different user", giving the name of the user in your system. Then VLC runs from root, playing everything placed inside the user's folders and everything placed in other hard disks (not root's disk though).
So far, so good.

Is there a possibility to run VLC as root in Gnome? I mean, without compiling the program myself with the option --enable-run-as-root. Is there any immediate method like in KDE?

Thank you!
 
Old 10-16-2010, 12:51 PM   #2
Stephannn
Member
 
Registered: Oct 2010
Location: San Francisco, CA
Distribution: Snow Leopard, Ubuntu, RedHat
Posts: 64

Rep: Reputation: 14
Doing a quick search for 'VLC as root' turns up quite a lot of frustration. In short, you *do* have to compile VLC yourself, to get it to run as root in GNOME.

That said, there are only two work-arounds. The first, is to change the permissions in your directories that have media to your user's group, enabling just your normal user account to access it (i.e. with 'read' or 'read/write' access.) Optionally, you could switch it to allow 'everyone' to read from them.

If (like me) you often run your system in 'root' the solution is to use 'vlc-wrapper' Running
Code:
# SUDO_UID=1000 vlc wrapper
will launch VLC with the same permissions as User ID 1000 (in my system, that's the first user I created when I installed Ubuntu; you can do a 'sudo cat /etc/passwd' to determine which user IDs belong to who.) This will allow execution of VLC in the root account, though you'll still need to make sure your media is accessible to whichever user you're making use of.

Sorry for the bad news.
 
Old 10-18-2010, 12:55 PM   #3
unixform
LQ Newbie
 
Registered: Jul 2009
Posts: 14

Original Poster
Rep: Reputation: 1
Smile OK!

These news are not really so bad...

Thanks!
 
Old 10-18-2010, 04:12 PM   #4
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
you can BUT WHY
running Gnome as root is A very very bad idea
DO NOT LOGIN AS ROOT !!!

there are very good security reasons that Gnome has made the root login hard to do
yes you can but DO NOT PLAY A MOVIE AS ROOT !!!!!!!!!
 
Old 10-19-2010, 04:54 AM   #5
anugraha.sinha
LQ Newbie
 
Registered: Oct 2010
Posts: 4

Rep: Reputation: 0
@ JOHN VV: why do you recommend that vlc or for that matter, a video should not be viewed as a root?
 
Old 10-19-2010, 05:48 AM   #6
craigevil
Senior Member
 
Registered: Apr 2005
Location: OZ
Distribution: Debian Sid/RPIOS
Posts: 4,884
Blog Entries: 28

Rep: Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533Reputation: 533
Why would you need to be root to play a video? That doesn't make any sense.

Nor does it ever make sense to run most GUI apps as root.

The few exceptions would be a text editor to edit a config, and running apps like rkhunter, chkrootkit, Bastille or other firewall GUIs, AV like klamav, Synaptic/Update Manager/Software Sources. There aren't that many other things that require running as root. And none of them require you to run Gnome/kde/xfce etc as root.

Linux Security Administrator's Guide: Host Security
Quote:
The most sought-after account on your machine is the superuser account. This account has authority over the entire machine, which may also include authority over other machines on the network. Remember that you should only use the root account for very short specific tasks and should mostly run as a normal user. Running as root all the time is a very very very bad idea.

Several tricks to avoid messing up your own box as root:

* When doing some complex command, try running it first in a non destructive way...especially commands that use globbing: e.g., you are going to do a rm foo*.bak, instead, first do: ls foo*.bak and make sure you are going to delete the files you think you are. Using echo in place of destructive commands also sometimes works.

* Provide your users with a default alias to the /bin/rm command to ask for confirmation for deletion of files.

* Only become root to do single specific tasks. If you find yourself trying to figure out how to do something, go back to a normal user shell until you are sure what needs to be done by root.
Safely Running Programs as root | Linux Journal
http://www.linuxjournal.com/article/2114

[SOLVED] GUI as root or not and why?
http://www.linuxquestions.org/questi...nd-why-788205/

Superuser Root System Administrator and Superuser in Linux
http://ezinearticles.com/?Superuser-...nux&id=2402909

The Linux System Administrator's Guide
http://tldp.org/LDP/sag/html/index.html

http://www.cybercon.org/Security/Doc...AdminGuide.pdf

LINUX: Rute User's Tutorial and Exposition
http://linux.2038bug.com/rute-home.html

Hopefully you get the idea, never run any apps as root unless you must.
 
Old 10-19-2010, 12:03 PM   #7
Stephannn
Member
 
Registered: Oct 2010
Location: San Francisco, CA
Distribution: Snow Leopard, Ubuntu, RedHat
Posts: 64

Rep: Reputation: 14
This could quickly and easily turn into the "don't work as root, it's EVIL" vs "it's my system, you're not my dad!" conversation.

There are lots of reasons someone might want to run their system as root, and lots of risks you take when you do. My guess is that the user in question has multiple user accounts with videos sitting in an SMB directory that's owned by several different people. Root is the only user who could (by default) browse a properly protected SMB directory in that case. A more elegant solution would be to set up more effective read/write permissions, but if it's a home file server with only two or three family members making use of it, running as root would seem to be a quick and effective solution. Different administrators have different needs; I'm the only user on all of my home 'nix boxes, so I work as root about %80 of the time. Being told I 'shouldn't' need to ask a question doesn't come close to addressing the questions posed.
 
Old 10-19-2010, 01:52 PM   #8
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Stephannn :
then one would use su , su -, or set up sudo
there IS NO NEED to login to a Gnome as root in order to run vlc


anugraha.sinha:
that is not what i said . one can always do what ever they want
but i do not recommend running Gnome and vlc IN GNOME as root
 
Old 10-19-2010, 04:53 PM   #9
Stephannn
Member
 
Registered: Oct 2010
Location: San Francisco, CA
Distribution: Snow Leopard, Ubuntu, RedHat
Posts: 64

Rep: Reputation: 14
@John,

I think of things like "drinking a fifth of vodka, then hopping on a snowmobile" as something that falls under the category of a "very very bad idea." I think of running Gnome (or VLC, or any other application I like) as root to fall under something akin to "if you're comfy with the chance that you'll wreck your system." It's always been infuriating for me, when I was trying to find information on how to do X, Y, or Z as root, and thread after thread of answers to similar questions is a long list of "you shouldn't, you moron." If I'm willing to pay the price for doing something in a manner others don't agree with, isn't that my business?
 
Old 10-20-2010, 02:10 AM   #10
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
If I'm willing to pay the price for doing something in a manner others don't agree with, isn't that my business?
If the system gets compromised because you work as root, you are hurting other systems and users.


Kind regards
 
Old 10-20-2010, 12:20 PM   #11
Stephannn
Member
 
Registered: Oct 2010
Location: San Francisco, CA
Distribution: Snow Leopard, Ubuntu, RedHat
Posts: 64

Rep: Reputation: 14
@repo,

Care to illustrate how working as root on a home system = a compromised system? Especially in the context of how often a linux box is compromised (specifically working as root) compared to the bajillions of Windows boxes that are compromised?

The kneejerk reaction against working as root is the point of comments. I agree, it's poor security policy to work as root. It doesn't make sense to fear using root in situations where I, as the systems administrator, deem it appropriate and necessary. Other administrators might not agree with the choice, as is entirely their right, but I've long ago decided I won't walk a mile out of my way to avoid hopping over a puddle.
 
Old 10-20-2010, 12:33 PM   #12
repo
LQ 5k Club
 
Registered: May 2001
Location: Belgium
Distribution: Arch
Posts: 8,529

Rep: Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899Reputation: 899
Quote:
Care to illustrate how working as root on a home system = a compromised system? Especially in the context of how often a linux box is compromised (specifically working as root) compared to the bajillions of Windows boxes that are compromised?
The system can be compromised, and if compromised while running as root, the consequences are bigger.

Kind regards
 
Old 10-20-2010, 02:55 PM   #13
John VV
LQ Muse
 
Registered: Aug 2005
Location: A2 area Mi.
Posts: 17,624

Rep: Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651Reputation: 2651
Quote:
Especially in the context of how often a linux box is compromised (specifically working as root) compared to the bajillions of Windows boxes that are compromised?
NOT running a desktop gui as root is one of the reasons that there are so few !
yes a case can be made for doing this once in a while ( fixing a busted OS, for one ) but there is no good , or bad , reason to run it as root all the time

in fact some things WILL NOT WORK in Gnome if you use the root hack .
Software updates is one .Most distros with gnome will not authenticate root if you are logged in as root
 
Old 10-20-2010, 03:14 PM   #14
Stephannn
Member
 
Registered: Oct 2010
Location: San Francisco, CA
Distribution: Snow Leopard, Ubuntu, RedHat
Posts: 64

Rep: Reputation: 14
Until recently, I had almost always run my desktops as root, as the integration of elevation to root privileges simply hadn't been effectively implemented. It's only been in the past couple years that switching to root to perform various administrative tasks has become relatively painless.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Run VLC using root account Ashish Sood Linux - General 48 10-22-2016 04:06 AM
Vlc won't start as root ASTRAPI Linux - Software 7 10-26-2009 12:06 PM
VLC not running as root....(Cent 5.2) spectrum007 Linux - Software 6 01-18-2009 06:59 AM
fedora 10 vlc cannot run as root me_logan Linux - Software 1 12-07-2008 04:45 PM
VLC or mplayer without root veraMOB Linux - Software 1 10-05-2007 08:05 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 11:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration