this post was submitted on 15 Apr 2024
1 points (100.0% liked)

Linux

47237 readers
3343 users here now

From Wikipedia, the free encyclopedia

Linux is a family of open source Unix-like operating systems based on the Linux kernel, an operating system kernel first released on September 17, 1991 by Linus Torvalds. Linux is typically packaged in a Linux distribution (or distro for short).

Distributions include the Linux kernel and supporting system software and libraries, many of which are provided by the GNU Project. Many Linux distributions use the word "Linux" in their name, but the Free Software Foundation uses the name GNU/Linux to emphasize the importance of GNU software, causing some controversy.

Rules

Related Communities

Community icon by Alpár-Etele Méder, licensed under CC BY 3.0

founded 5 years ago
MODERATORS
 

I found a (lengthy) guide to doing this but it is for gksu which is gone. I have to imagine there's an easy way. I am running Ubuntu. There is no specific use case, it is just a feature I miss from windows.

all 22 comments
sorted by: hot top controversial new old
[–] [email protected] 1 points 5 months ago* (last edited 5 months ago)

I don't know why everyone is getting self-righteous about this. I've used Linux since the mid-90s, and occasionally I find it easier to just run a GUI file manager as root to do some filter and deletions of things in caches and such that need root permission. Hell, I want to edit the files in /etc/wireguard for my tunnels; should I only do this at a sudo prompt in the terminal when I'm perfectly capable of pulling it up in Kate and copypasting stuff in?

Get off your high horses, there's plenty of valid use cases if you're using your head.

[–] [email protected] 1 points 5 months ago

Other threads:

You are free to do anything and everything with Linux!

ITT:

YOU CAN'T DO THAT

[–] [email protected] 0 points 5 months ago (1 children)

You don't need to run any GUI programs as root.

[–] [email protected] 0 points 5 months ago (1 children)

Sudo is "su do", i.e. "run as root", so it's funny to hear run as sudo because it means "run as run as root", like "chai tea" or "ATM machine".

To your question the answer is "why?". You shouldn't need that, that's one of the hardest things to get rid of, the "Windows mentality", it's like when people ask how to install a .tar.gz they downloaded from the internet, the answer is most likely "you don't need that".

This leads to an XY problem, where you're asking how to solve problem Y but that is caused by you assuming you need to do X, when in fact you don't. The main clue is that people keep asking you why do you want to do this. So, what exactly is the problem you're trying to solve? Why do you think you need this?

[–] [email protected] 0 points 5 months ago (1 children)

There is no reason to assume this is an XY problem scenario.

[–] [email protected] 0 points 5 months ago (1 children)

Yes there is, you're asking how to add a menu entry to run things with sudo, and refuse to answer why you want to do it, what's your use case? What graphical application do you need to run with sudo and why?

I'm almost sure I know why, and your refusal to answer this even though it's been asked multiple times seems fishy. Like it was explained multiple times there's a 99% chance that you don't need it, and there is a package for the remaining 1% or you could do it manually like others have suggested. But until we know your use case we can't help you, so while you keep refusing to explain what is it that you're actually trying to accomplish and why do you feel you need it it will be impossible for anyone to help you.

[–] [email protected] 0 points 5 months ago (1 children)

What I want to accomplish is to open files and programs as root without use of the terminal. I promise you I have no nefarious intentions towards you or your ilk.

[–] [email protected] 0 points 5 months ago (1 children)

What program? What files? Why do you need to run them with sudo? You're either being purposefully vague or you don't even know why you think you need this.

[–] [email protected] 0 points 5 months ago* (last edited 5 months ago) (1 children)

The question is not about a specific use-case, but a general one. An alternative reading would be "Is there a way to run short commands as root without switching to the terminal?"

[–] [email protected] 0 points 5 months ago (1 children)

I have had to un-teach dumb things that people learn from Windows.

A menu item to run a GUI program as root it is indeed a rather absurd scenario. It suggests that you want to violate the admin/user barrier which is intended to be difficult to surpass except in certain circumstances.

There can be a lot of things under the hood that are necessary to run a GUI program as root depending on whether you're using X11 or Wayland or something more esoteric. It's doable though.

But instead of doing that, why not just learn how to use the command line? Every administrative task can be done via the command line, but not every administrative task has a GUI counterpart. So you're going to need to learn to use the command line sooner or later.

[–] [email protected] 0 points 5 months ago* (last edited 5 months ago) (1 children)

OP asks a relatively simple question, and gets scolded as it committed murder.

For all we know OP is the only user and is just playing with Linux, and just wants a simple (probably unnecessary) shortcut because he's GUI oriented.

This is kind of someone asking how to open their lunchbox easier, and get treated like they are giving a copy of their house keys to everyone in town.

Chill... Not everyone is running a maximum security level server. If OP screws their system (like most of us do at some point), I'm sure a fresh re-install would be enough for them.

[–] [email protected] 0 points 5 months ago (1 children)

Thank you lol this thread got absurd.

"I won't tell you to open your lunchbox until you tell me what you brought for lunch and the allergies of anyone in your family."

[–] [email protected] 0 points 5 months ago (1 children)

Except the question you're asking is more akin to "How do I fold my lunchbox?" And refused to provide any more meaning to what you want other than "I used to fold my tinfoil, I now have a lunchbox and want to fold it in the same way, it's not difficult".

You're asking something that you shouldn't do, you only need this because you already did it before and broke a lot of the permissions in your system which by your own account caused you headaches. In other words you already folded the lunchbox and when it broke instead of stopping and thinking about what you did wrong you proceeded on asking on the internet what's the proper way to fold your lunchbox.

[–] [email protected] 0 points 5 months ago (1 children)

Amazing. Yes, when I said "open" I actually secretly meant "fold", a totally normal and common mistake users make when accessing the contents of a lunchbox. Everything is an XY problem!

[–] [email protected] -1 points 5 months ago

Except you didn't, that's what you're missing, you're asking how to do a Windows thing on Linux, and despite everyone telling you you don't need this you keep insisting on it. Your whole problem started because you ran a program with sudo, and instead of acknowledging your mistake and asking how to fix the original problem and un-clusterfuck your drives you double down and insist the community is being toxic because they refuse to tell you how to easily keep insisting on the error.

[–] [email protected] 0 points 5 months ago (1 children)

There is a lot of advice in this thread warning you about doing this. Please heed it. Instead, read more about how permissions and file ownership works.

[–] [email protected] 0 points 5 months ago (2 children)

I appreciate the absolute mountains of concern that I am using my own computer incorrectly, but I've been doing it this way for more than a decade and have never once broken anything, lost data or exposed myself to a security risk so I think I'm doing ok.

[–] [email protected] -1 points 5 months ago* (last edited 5 months ago)

You are absolutely not. It really bad practice. I can not state that enough.

Practice least privilege

I'm not trying to offend you. I just want to help.

[–] [email protected] -1 points 5 months ago

I've gone swimming in specifically man eating shark infested waters for years and nothing bad has happened. So surely nothing bad will ever happen, and my actions have no risk tied to them. Think about why so many people have discouraged the actions you propose, safety rules are written in blood after all. You can, in fact do whatever you want, just keep it in mind when you are doing something risky.