Question about GUI and root?
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions use the other forums in the support section.
Before you post read how to get help. Topics in this forum are automatically closed 6 months after creation.
Question about GUI and root?
Hello, I just started using linux mint 20.3 a few weeks ago. Last week I successfully learned to compile the kernel 6.1.8 for my desktop. All works fine. Now I am trying to learn some more about the proper way to use some commands yet get various answers online so would like to make sure I am doing this correctly. Sometimes I need to use nemo as root. I am using pkexec nemo Is this the correct way? I notice preferences such as sorting folders are not saved and some errors exist.
Last edited by LockBot on Thu Aug 03, 2023 10:00 pm, edited 2 times in total.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Reason: Topic automatically closed 6 months after creation. New replies are no longer allowed.
Re: Question about GUI and root?
Open terminal. sudo nemo
There are errors with most programs when used this way. There are dangers with running any program as root. Nemo as root can open files like /etc/hosts for editing. In the case of hosts, a safer way is to leave nemo as normal and sudo xed /etc/hosts
There are errors with most programs when used this way. There are dangers with running any program as root. Nemo as root can open files like /etc/hosts for editing. In the case of hosts, a safer way is to leave nemo as normal and sudo xed /etc/hosts
- Pjotr
- Level 23
- Posts: 19886
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Question about GUI and root?
Don't do that! This can seriously damage the permissions in your /home.Petermint wrote: ⤴Sat Feb 04, 2023 5:21 am Open terminal. sudo nemo
There are errors with most programs when used this way. There are dangers with running any program as root. Nemo as root can open files like /etc/hosts for editing. In the case of hosts, a safer way is to leave nemo as normal and sudo xed /etc/hosts
This is the safe and recommended way to do it:
https://easylinuxtipsproject.blogspot.c ... -root.html
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Question about GUI and root?
especially for nemo: Open Settings -> Context Menus -> Activate: Open as Root
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
Re: Question about GUI and root?
I was using pkexec however I read if it isnt set up properly it will run as root anyways? seems confusing. I am not sure how to set it up.Pjotr wrote: ⤴Sat Feb 04, 2023 6:10 amDon't do that! This can seriously damage the permissions in your /home.Petermint wrote: ⤴Sat Feb 04, 2023 5:21 am Open terminal. sudo nemo
There are errors with most programs when used this way. There are dangers with running any program as root. Nemo as root can open files like /etc/hosts for editing. In the case of hosts, a safer way is to leave nemo as normal and sudo xed /etc/hosts
This is the safe and recommended way to do it:
https://easylinuxtipsproject.blogspot.c ... -root.html
- Pjotr
- Level 23
- Posts: 19886
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Question about GUI and root?
No worries; the Ubuntu and Mint devs have already set up pkexec for you, for the most common applications that might need to be used with root permissions from time to time.Iridule wrote: ⤴Sat Feb 04, 2023 11:09 amI was using pkexec however I read if it isnt set up properly it will run as root anyways? seems confusing. I am not sure how to set it up.Pjotr wrote: ⤴Sat Feb 04, 2023 6:10 am This is the safe and recommended way to do it:
https://easylinuxtipsproject.blogspot.c ... -root.html
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Question about GUI and root?
Ok, thanks. so i suppose pkexec nemo is safe? What about the warnings I get? Also not able to save folder order settingsPjotr wrote: ⤴Sat Feb 04, 2023 2:59 pmNo worries; the Ubuntu and Mint devs have already set up pkexec for you, for the most common applications that might need to be used with root permissions from time to time.Iridule wrote: ⤴Sat Feb 04, 2023 11:09 amI was using pkexec however I read if it isnt set up properly it will run as root anyways? seems confusing. I am not sure how to set it up.Pjotr wrote: ⤴Sat Feb 04, 2023 6:10 am This is the safe and recommended way to do it:
https://easylinuxtipsproject.blogspot.c ... -root.html
- Pjotr
- Level 23
- Posts: 19886
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Question about GUI and root?
Usually, in this case any warnings are innocent. So: what warnings?
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
-
- Level 8
- Posts: 2033
- Joined: Wed Aug 14, 2019 1:02 am
Re: Question about GUI and root?
"sudo" or "pkexec" is unnecessary for file browsers such as nemo/caja/thunar. The proper way is launch them normally, right click in their empty space, then "Open as Administrator" or "Open as Root".
Re: Question about GUI and root?
Those are not warnings but errors, most probably related with gvfs/D-bus. See issue on github.
Last edited by Jo-con-Ël on Sun Feb 05, 2023 5:02 am, edited 2 times in total.
Arrieritos semos y en el camino nos encontraremos.
- ricardogroetaers
- Level 6
- Posts: 1368
- Joined: Sat Oct 27, 2018 3:06 am
- Location: Rio de Janeiro, Brasil
Re: Question about GUI and root?
I don't know Nemo, I use Thunar.
I reasonably assume that Nemo, launched as a regular user, should have an option, in a context menu, to open a certain folder as root.
So I see no reason to run Nemo File Manager as root all the time.
Don't ask me about the engineering of the thing, because I don't know it.
In practice, without analyzing, demonstrating and explaining why:
pkexec is a "graphical prefix" (which unfortunately does not work with all programs) to launch "normally graphical" applications with privileges.
It must be placed, as a prefix, in the "command" field of the graphical launcher that launches the program.
It must not be invoked from a terminal window (command prompt).
See the example picture under XFCE to launch the "gnome-disks" program.
If I want to launch this graphical program with privileges, I put, in the "command field" of the launcher:
pkexec gnome-disks
The problem is that gnome-disks doesn't accept pkexec or pkexec doesn't work with gnome-disks.
Last edited by ricardogroetaers on Sun Feb 05, 2023 5:44 am, edited 1 time in total.
- Pjotr
- Level 23
- Posts: 19886
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Question about GUI and root?
It's quite alright to launch a graphical application with pkexec from a terminal window. No problem at all.ricardogroetaers wrote: ⤴Sun Feb 05, 2023 4:09 am pkexec is a "graphical prefix" (which unfortunately does not work with all programs) to launch "normally graphical" applications with privileges.
It must be placed, as a prefix, in the "command" field of the graphical launcher that launches the program.
It must not be invoked from a terminal window (command prompt).
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
- ricardogroetaers
- Level 6
- Posts: 1368
- Joined: Sat Oct 27, 2018 3:06 am
- Location: Rio de Janeiro, Brasil
- Pjotr
- Level 23
- Posts: 19886
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Question about GUI and root?
Yes, that's true. The terminal remains in charge. Closing the terminal window will also close the application. But that's only a cosmetic "problem"....ricardogroetaers wrote: ⤴Sun Feb 05, 2023 5:49 amIt may work, but it will hold that terminal window until we close the program.
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Question about GUI and root?
Not exactly. Using
&
operator Code: Select all
pkexec nemo &
You can close the terminal and nemo will remain running. Or you can press control+C and type your commands in terminal, or even type command without sending SIGINT (see free below):
Code: Select all
┌──(mf㉿D12T7)-[~]
└─$ pkexec nemo &
[1] 11588
┌──(mf㉿D12T7)-[~]
└─$
(nemo:11588): GLib-GIO-CRITICAL **: 11:42:20.884: g_dbus_interface_skeleton_export: assertion 'G_IS_DBUS_CONNECTION (connection)' failed
** (nemo:11588): WARNING **: 11:42:20.889: Current gtk theme is not known to have nemo support (Menta) - checking...
(nemo:11588): dconf-WARNING **: 11:42:21.173: failed to commit changes to dconf: Failed to execute child process ?dbus-launch? (No such file or directory)
(nemo:11588): dconf-WARNING **: 11:42:21.174: failed to commit changes to dconf: Failed to execute child process ?dbus-launch? (No such file or directory)
ERROR SET META:15 Setting attribute metadata::nemo-icon-view-auto-layout not supported
free
total used free shared buff/cache available
Mem: 8043832 1739216 3155168 389724 3149448 5648592
Swap: 0 0 0
┌──(mf㉿D12T7)-[~]
└─$
-=t42=-
- Pjotr
- Level 23
- Posts: 19886
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Question about GUI and root?
Nice!t42 wrote: ⤴Sun Feb 05, 2023 6:56 amNot exactly. Using&
operatorwill opens nemo in background, providing nemo PID and leaving the terminal free to run commands.Code: Select all
pkexec nemo &
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Question about GUI and root?
and withPjotr wrote: ⤴Sun Feb 05, 2023 7:43 am
Not exactly. Using&
operatorwill opens nemo in background, providing nemo PID and leaving the terminal free to run commands.Code: Select all
pkexec nemo &
Nice!
Code: Select all
pkexec nemo & disown
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
- Pjotr
- Level 23
- Posts: 19886
- Joined: Mon Mar 07, 2011 10:18 am
- Location: The Netherlands (Holland) 🇳🇱
- Contact:
Re: Question about GUI and root?
Noch schöner!Bleys wrote: ⤴Sun Feb 05, 2023 11:56 amand withPjotr wrote: ⤴Sun Feb 05, 2023 7:43 am
Not exactly. Using&
operatorwill opens nemo in background, providing nemo PID and leaving the terminal free to run commands.Code: Select all
pkexec nemo &
Nice!you can close the terminal after the nemo start.Code: Select all
pkexec nemo & disown
Tip: 10 things to do after installing Linux Mint 21.3 Virginia
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Keep your Linux Mint healthy: Avoid these 10 fatal mistakes
Twitter: twitter.com/easylinuxtips
All in all, horse sense simply makes sense.
Re: Question about GUI and root?
But the easiest way is still to activate the context entry "Open as Root" in the nemo settings. As I have already mention above...
Aber am einfachsten ist es immer noch in den nemo Einstellungen den Kontext Eintrag "Als Systemverwalter öffnen" zu aktivieren. Wie ich weiter oben schon mal geschrieben habe...
Ryzen 5 5600G, 16GB RAM, 2TB M.2 Crucial P3, Asrock Deskmeet X300, Samsung Odyssey 49", Linux Mint 21
Re: Question about GUI and root?
I realize It is much easier to open using context menu but is nice to know pkexec is safer to use than sudo nemo. Thanks everyone for their replies.Bleys wrote: ⤴Sun Feb 05, 2023 12:09 pmBut the easiest way is still to activate the context entry "Open as Root" in the nemo settings. As I have already mention above...
Aber am einfachsten ist es immer noch in den nemo Einstellungen den Kontext Eintrag "Als Systemverwalter öffnen" zu aktivieren. Wie ich weiter oben schon mal geschrieben habe...