Main user can't open apps and folders with highest privileges - password does not work

Hi everyone!
New evening, new findings on Linux!

As from title, I get some confusion regarding my user’s administration settings. The problem emerged when I tried to delete a folder in the home directory (it was an application I wanted to get rid of) but I could not due to access denied.

Trying to figure out how to solve,I ran through “Menu Editor” a default application that can set some parameters about how applications launch. In particular it allows to set whether a specific app needs to be opened through a different user, hence I set this to “root” for Dolphin (the File Explorer), saved and close.

When trying to open Dolphin at this point, it asks me the password (through the prompt with which the psw is usually working for the system) but does not accept the correct one and further prompts me the following.

Obviously using the same password doesn’t help.

I’m kind of stuck because I don’t know how to add my user to other groups and do not even know to which group I should add it (it suggests ‘wheel’ but why not ‘root’?)

Can anyone help me in figuring this out?

Thanks a lot!

EDIT:
The point is that I basically want my user to have highest privileges through the entire use of the system, just making it prompts to ask the psw for most delicate processes

Hi,

Thats already a possible problem … your HOME should all be owned by your user.

This would not be the method … but also … you should not open graphical applications as root or with sudo. There used to exist programs specifically for it like gtksudo … but they have long been retired because it was realized to be a bad idea that could not be implemented properly.

Hopefully you can undo this change. Tell us if not.

Then we can help with any further deletions or permissions.

Hi!!
Thanks for the fast help… AGAIN!

Yes I can totally undo the change and it does not provide any restriction (If I click “Ignore” on the prompted window I can normally access Dolphin)

I rolled back the modification through Menu Editor.

Hi,
Sure :slight_smile:
So … is the issue now that you still have a folder/file to remove that you cannot?
Maybe we can have you list the files and permissions…
(provide path as necessary, such as if a folder in home “Games”)

ls -la ~/Games

Yes, the issue still applies, in particular, this comes out:
image

ls -ls ~/synergy-core                                                                       ✔  base  
total 232
 4 -rw-r--r-- 1 root root   3973 giu 16 12:45 azure-pipelines.yml
 4 -rw-r--r-- 1 root root    143 giu 16 12:45 Build.properties
36 -rw-r--r-- 1 root root  35914 giu 16 12:45 ChangeLog
 4 drwxr-xr-x 5 root root   4096 giu 16 12:45 CI
 4 drwxr-xr-x 2 root root   4096 giu 16 12:45 cmake
16 -rw-r--r-- 1 root root  16248 giu 16 12:45 CMakeLists.txt
 4 -rw-r--r-- 1 root root     86 giu 16 12:45 crowdin.yml
 4 drwxr-xr-x 3 root root   4096 giu 16 12:45 debian
 4 drwxr-xr-x 5 root root   4096 giu 16 12:45 dist
 4 drwxr-xr-x 2 root root   4096 giu 16 12:45 doc
108 -rw-r--r-- 1 root root 108611 giu 16 12:45 Doxyfile
 4 drwxr-xr-x 5 root root   4096 giu 16 12:45 ext
 4 drwxr-xr-x 2 root root   4096 giu 16 12:45 flatpak
16 -rw-r--r-- 1 root root  15464 giu 16 12:45 LICENSE
 4 -rw-r--r-- 1 root root   2067 giu 16 12:45 README.md
 4 drwxr-xr-x 3 root root   4096 giu 16 12:45 res
 4 drwxr-xr-x 2 root root   4096 giu 16 12:45 scripts
 4 drwxr-xr-x 6 root root   4096 giu 16 12:45 src

Mk.
Out of interest - howd it get there?

Anyhoo … if you want to remove it you can use the handy sudo
(some explanation … despite often being considered ‘super user do’ … sudo is in fact simply ‘do as other user’ but defaults that user to ‘root’ when no argument is passed … hence sudo someaction becomes ‘do someaction as root’ … and rm is remove of course … you need the -r for recursion - a requirement for folders)

sudo rm -r ~/synergy-core

Depending on how that directory ended up there in the first place … you may want to check your HOME to make sure the permissions are correct.

On to the rest of your thread…
I would try to dissuade you from trying to do what you think you want to do.
Linux, as a permissions based system … is intended to be used this way. Generally actions that require these privileges do so for a reason.

There are some good introductions out there … which I am terrible at finding for the moment.
Ah … besides these two … which may or may not be useful to you.

Ok it worked without problems.
It arrived there because I installed this software through git clone and it was placed by default in home directory, if I remember correctly.

I’m actually interested in what you were saying here:

I want to understand what is the hierarchy in the privileges possessions in the system, and especially want to know why my password could not work in some situations.

EDIT
Ok, gonna read those.
Do they also help me with this?

Beyond root being the dominant one-above-all there isnt a true hierarchy … users or groups can have permissions for only certain commands or files … only read access (cannot write anything), and so on.

Did you possibly use sudo git clone or had previously used su before the clone ?

A simple git clone someurl.com/thing.git should by default be done as regular user and the resulting directory owned by the same user. It also defaults to downloading wherever the command was invoked … by default your terminal opens at your HOME.

Which brings us to the next:

Maybe just a quick run of ls -la in your HOME … just see that it prints your user for all the listings.

The guides are just what I could grab on hand … one from a team member intended for new linux users … and one of my personal favorite ‘get comfortable with basics in the terminal’ interactive tutorials.

Ok but how can I get access to these groups and modify them?
You convinced me about this:

I just want to know what I can access and what I cannot.

Yes this could have totally happened.

total 5384
drwx------ 37 alessandrob alessandrob    4096 lug  5 01:16  .
drwxr-xr-x  3 root        root           4096 mag 16 04:39  ..
-rwxrwxrwx  1 alessandrob alessandrob 5223077 giu 21 17:29 '2023-06-21 17-25-12.mp4'
drwxr-xr-x  3 alessandrob alessandrob    4096 giu  5 11:48  .anaconda
drwxr-xr-x 27 alessandrob alessandrob    4096 giu  6 13:26  anaconda3
-rw-r--r--  1 alessandrob alessandrob      21 gen  9  2022  .bash_logout
-rw-r--r--  1 alessandrob alessandrob      57 gen  9  2022  .bash_profile
-rw-r--r--  1 alessandrob alessandrob    4323 giu  5 14:29  .bashrc
drwxr-xr-x 38 alessandrob alessandrob    4096 lug  5 00:52  .cache
drwxr-xr-x  3 alessandrob alessandrob    4096 giu  5 12:01  .conda
-rw-r--r--  1 alessandrob alessandrob      23 giu  5 11:50  .condarc
drwxr-xr-x 39 alessandrob alessandrob    4096 lug  5 01:16  .config
drwxr-xr-x  3 alessandrob alessandrob    4096 giu  5 11:48  .continuum
-rw-r--r--  1 alessandrob alessandrob    4855 ott 30  2017  .dir_colors
drwxr-xr-x  6 alessandrob alessandrob    4096 giu  7 15:37  Documenti
drwxr-xr-x  3 alessandrob alessandrob    4096 lug  4 23:18  .dotnet
drwx---rwx  3 alessandrob alessandrob    4096 giu  5 16:55  FiraxisLive
-rw-r--r--  1 alessandrob alessandrob     110 mag 17 15:57  .fonts.conf
drwx------  2 alessandrob alessandrob    4096 mag 22 01:17  .GameGuide
drwxr-xr-x  3 alessandrob alessandrob    4096 giu  5 14:42  Games
-rw-r--r--  1 alessandrob alessandrob     156 lug  4 23:35  .gitconfig
drwx------  2 alessandrob alessandrob    4096 mag 29 11:38  .gnupg
drwxr-xr-x  2 alessandrob alessandrob    4096 lug  4 23:49  .gphoto
-rw-r--r--  1 alessandrob alessandrob     265 lug  4 22:38  .gtkrc-2.0
drwxr-xr-x  3 alessandrob alessandrob    4096 giu  6 11:19  gurobi1001
-rw-r--r--  1 alessandrob alessandrob     524 giu  6 11:29  gurobi.lic
drwxr-xr-x  3 alessandrob alessandrob    4096 giu  1 11:36  Immagini
drwxr-xr-x  5 alessandrob alessandrob    4096 giu  6 15:28  .ipython
drwxr-xr-x  4 alessandrob alessandrob    4096 giu  5 11:52  .java
drwxr-xr-x  3 alessandrob alessandrob    4096 mag 18 20:24  .lazarus
drwxr-xr-x  4 alessandrob alessandrob    4096 mag 16 05:02  .local
drwxr-xr-x  2 alessandrob alessandrob    4096 mag 16 05:02  Modelli
drwx------  4 alessandrob alessandrob    4096 mag 16 05:35  .mozilla
drwxr-xr-x  2 alessandrob alessandrob    4096 mag 16 05:02  Musica
-rw-r--r--  1 alessandrob alessandrob      53 giu  3  2022  .nanorc
drwxr-xr-x  4 alessandrob alessandrob    4096 lug  4 23:18  .nuget
drwx------  3 alessandrob alessandrob    4096 mag 16 05:02  .nv
-rw-r--r--  1 alessandrob alessandrob    2065 giu 13 15:54  .nvidia-settings-rc
drwx------  3 alessandrob alessandrob    4096 mag 16 20:22  .pki
drwxr-xr-x  2 alessandrob alessandrob    4096 mag 16 05:02  Pubblici
drwxr-xr-x  3 alessandrob alessandrob    4096 giu 23 12:04  PycharmProjects
drwx------  2 alessandrob alessandrob    4096 mag 22 01:17  .QtWebEngineProcess
drwxr-xr-x  3 alessandrob alessandrob    4096 lug  4 23:09  Scaricati
drwxr-xr-x  2 alessandrob alessandrob    4096 lug  2 16:44  Scrivania
drwx------  2 alessandrob alessandrob    4096 giu  5 16:23  .snap
drwxr-xr-x  2 alessandrob alessandrob    4096 lug  4 21:17  .steam
lrwxrwxrwx  1 alessandrob alessandrob      36 lug  4 19:15  .steampath -> /home/alessandrob/.steam/sdk32/steam
lrwxrwxrwx  1 alessandrob alessandrob      34 lug  4 19:15  .steampid -> /home/alessandrob/.steam/steam.pid
drwxr-xr-x  3 alessandrob alessandrob    4096 mag 24 13:15  .var
drwxr-xr-x  2 alessandrob alessandrob    4096 mag 16 05:02  Video
-rw-r--r--  1 alessandrob alessandrob     289 giu 25 23:44  .wget-hsts
drwxr-xr-x  4 alessandrob alessandrob    4096 giu 25 23:47  .wine
-rw-------  1 alessandrob alessandrob     110 lug  4 22:38  .Xauthority
-rwxr-xr-x  1 alessandrob alessandrob     100 ott 30  2017  .Xclients
-rwxr-xr-x  1 alessandrob alessandrob    1656 giu 22 17:31  .xinitrc
-rw-r--r--  1 alessandrob alessandrob   48968 lug  4 23:21  .zcompdump
-rw-------  1 alessandrob alessandrob    9737 lug  5 01:16  .zhistory
-rw-r--r--  1 alessandrob alessandrob     791 giu  5 14:56  .zshrc

Gonna read those guides and also further articles if contained there! Thanks!
Gotta go now, gonna read answers tomorrow!

It is a bit of a whole subject, but here are some pages:

Users and groups - ArchWiki

File permissions and attributes - ArchWiki

Sudo - ArchWiki

You will also find a not-recommended example of ‘disabling asking for permissions’ here:

https://wiki.archlinux.org/title/Sudo#Example_entries

By default that should be everything in your HOME, Trash, and TMPFS (/tmp)
Pretty much everything else will be owned by root.
Modern utilities use polkit to dynamically ask for elevated permissions … for example Kate - you do not need to sudo kate even on a root owned file … just open it … and if you make changes and save … it will ask for the password.

It is also worth mentioning here that the root password and your (or any) given user password are not necessarily the same. Many single-user admins set it up this way … but it would have been a choice at install.

Looks fine to me.

Cheers. :vulcan_salute:

1 Like

You’re doing that wrong.

  • First of all, because you’ve done it this way, the password it’s asking for is the root account’s password, not your own password as you use with sudo.

  • Secondly, in order to use any component of Plasma with elevated privileges, you should prefix the command with pkexec.

But read on… :arrow_down:

UNIX was designed to allow users to do everything that’s needed and nothing that can jeopardize the stability and security of the system. You should always use the principle of least privileges.


Indeed, because it’s a recipe for disaster.


Without elevated permissions, you have write access to your ${HOME}, to /tmp and to /var/tmp, and if your system runs its own mail server, to /var/spool/mail/${USER}. Everything else is read-only for unprivileged users.

The root account on the other hand has write access to everything, which is exactly why you should not elevate your privileges in vain.

1 Like

Thanks a lot!

I got the point and I will read through the material you provided me!

Thank you for the further details and for the answer.
I get the usefulness of non-privileged usage.

I guess I could reckon the password I set for root permission, just in case.

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.