When I operate at terminal, if I do something when needs root privilege, I need to prefix my command using 'sudo' and I may be prompted to enter password of root. If I feel it too inconvenient to prefix 'sudo' each time, I can even change myself to root by 'su' command. But when I operate in GUI mode, how can I do in both cases?
Asked
Active
Viewed 853 times
0
-
1What are you actually trying to achieve? Why do you *always* need to run GUI applications as root? – pomsky Nov 05 '19 at 08:30
-
Take an example, file managing is much easier to be done in GUI than in CLI. – Stan Huang at Taiwan Nov 05 '19 at 08:46
-
1But *why* do you need to run it as root *always*, even when dealing with local user's files? Incorrectly running GUI applications with `sudo` [may lead to disastrous consequences](https://askubuntu.com/q/270006/480481). Are you looking for [how to enable root login](https://askubuntu.com/q/270006/480481) (again, highly *not* recommended)? – pomsky Nov 05 '19 at 09:07
-
2It is risky to work with superuser privileges all the time. It is a good idea to use it **only when absolutely necessary** (use `sudo` with text mode applications and **`sudo -H` or `pkexec` or some other method with GUI applications**). See also [this link](https://askubuntu.com/questions/961967/why-dont-gksu-gksudo-or-launching-a-graphical-application-with-sudo-work-with-w/961978#961978) – sudodus Nov 05 '19 at 09:09
-
It is explained here. Very simple steps: https://www.youtube.com/watch?v=WOVKjQGkrac I tried it. It works. – MVD Dec 16 '22 at 23:56