Linux - SoftwareThis 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
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
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?
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.
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.
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.
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.
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?
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.
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.
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
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.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.