SparkyLinux Forums

Software & hardware support => Applications => Topic started by: vance on May 21, 2022, 08:17:13 PM

Title: Not authorized to perform operation
Post by: vance on May 21, 2022, 08:17:13 PM
I have installed sparkylinux-6.3-x86_64-lxqt on a Leonvo Thinkcentre 6234a1u.  I want to also praise the admins for having an OS that installs very fast but also is full featured!  My problem though is after some use & maybe changing minor things I end up not being able to have a 2nd SATA hard drive plugged into the system & access its contents.  It is an NTFS formatted drive although I've tested trying to access ext4 drives also & I get an error that says "Not authorized to perform operation".  After some research, I think this is a problem that developes in the lxqt-policykit module.  Is there a way to reset the configuration to again allow access to the drives through PCManFM-QT File Manager?
Thanks in advance!!!
Vance
Title: Re: Not authorized to perform operation
Post by: pavroo on May 21, 2022, 10:15:40 PM
The question is: do you can not mount the ntfs partition or, you can, but can not have read/write access to the partition?
Title: Re: Not authorized to perform operation
Post by: vance on May 21, 2022, 11:06:46 PM
When I've installed the OS in the past before I have trouble with it I can mount it automatically through the GUI just fine.  I haven't tried but I would image I would have read/write.  The problem is when the problem develops, I put the password in but it immediately gives me the error.  So far the only way to fix the error is to reload the OS.  I'm hoping there is a way to fix that.  I can reboot & it still gives me the error as it is now.
Thanks for the fast response!!
Vance
Title: Re: Not authorized to perform operation
Post by: pavroo on May 22, 2022, 12:55:24 AM
Show me output of:
ls -l /usr/bin/lxqt-policykit-agent
pidof lxqt-policykit-agent
and
sparky-polkit
If sparky-polkit is not installed, install if and show me as above, please.
Title: Re: Not authorized to perform operation
Post by: vance on May 22, 2022, 02:18:05 AM
Output copied & pasted from terminal window of all the commands you asked me to run:
sysadmin@6234a1u:~$ ls -l /usr/bin/lxqt-policykit-agent
-rwxr-xr-x 1 root root 43152 Jan  6  2021 /usr/bin/lxqt-policykit-agent
sysadmin@6234a1u:~$ pidof lxat-policykit-agent
sysadmin@6234a1u:~$ sparky-polkit
bash: sparky-polkit: command not found
sysadmin@6234a1u:~$ sudo synaptic-pkexec
[sudo] password for sysadmin:
sysadmin@6234a1u:~$ sparky-polkit
lxde polkit is installed
lxqt polkit is running, exiting...
sysadmin@6234a1u:~$
I used Synaptic to install the sparky-polkit package.  Because I had gotten the error without rebooting before going into Synaptic I had to use the terminal window to get into Synaptic.

I think this is normal but as I used Synaptic to install the package sparky-polkit I got this in the details:
debconf: unable to initialize frontend: Gnome
debconf: (Can't locate Gtk3.pm in @INC (you may need to install the Gtk3 module) (@INC contains: /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.32.1 /usr/local/share/perl/5.32.1 /usr/lib/x86_64-linux-gnu/perl5/5.32 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.32 /usr/share/perl/5.32 /usr/local/lib/site_perl) at /usr/share/perl5/Debconf/FrontEnd/Gnome.pm line 151, <> line 3.)
debconf: falling back to frontend: Dialog
Selecting previously unselected package lxsession-data.
(Reading database ... 150463 files and directories currently installed.)
Preparing to unpack .../lxsession-data_0.5.5-2_all.deb ...
Unpacking lxsession-data (0.5.5-2) ...
Selecting previously unselected package lxpolkit.
Preparing to unpack .../lxpolkit_0.5.5-2_amd64.deb ...
Unpacking lxpolkit (0.5.5-2) ...
Selecting previously unselected package sparky-polkit.
Preparing to unpack .../sparky-polkit_0.2.5_all.deb ...
Unpacking sparky-polkit (0.2.5) ...
Setting up lxsession-data (0.5.5-2) ...
Setting up lxpolkit (0.5.5-2) ...
Setting up sparky-polkit (0.2.5) ...
Processing triggers for man-db (2.9.4-2) ...

Thanks again Pavrroo for helping me analyze this problem!
Vance
Title: Re: Not authorized to perform operation
Post by: vance on May 22, 2022, 02:23:29 AM
You probably saw the typo I did.  When I typed it correctly the pidof command returned 1115.  I know I could normally copy & paste but for some reason I couldn't signin to the forum on the computer where I'm having the problem.  I'm currently using another computer for the forum.
Thanks again!!
Vance
Title: Re: Not authorized to perform operation
Post by: vance on May 22, 2022, 02:49:46 AM
So, is this the problem?

lxde polkit is installed
lxqt polkit is running, exiting...

Thanks!!
Vance
Title: Re: Not authorized to perform operation
Post by: pavroo on May 22, 2022, 05:48:53 PM
The output says that lxqt-polkit is active as it should be.
Do you have the 'ntfs-3g' and 'fuse' packages installed?

If yes, try to mount your ntfs partition manually.
Check what is your ntfs partition:
sudo fdisk -lthen mount it in /mnt for example:
sudo mount -t ntfs /dev/sdaX /mntChange sdaX to your partition number.

If any problem, post your output.
Title: Re: Not authorized to perform operation
Post by: vance on May 22, 2022, 09:53:35 PM
Output pasted from a terminal window executing the commands you specified:
sysadmin@6234a1u:~$ sudo fdisk -l
[sudo] password for sysadmin:
Disk /dev/sdb: 931.51 GiB, 1000204886016 bytes, 1953525168 sectors
Disk model: ST31000524AS   
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x67318a19

Device     Boot Start        End    Sectors   Size Id Type
/dev/sdb1          63 1953520064 1953520002 931.5G  7 HPFS


Disk /dev/sda: 37.25 GiB, 40000000000 bytes, 78125000 sectors
Disk model: ST340014AS     
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 512 bytes / 512 bytes
Disklabel type: dos
Disk identifier: 0x19a8bfd6

Device     Boot    Start      End  Sectors  Size Id Type
/dev/sda1  *        2048 70311889 70309842 33.5G 83 Linux
/dev/sda2       70311890 78124094  7812205  3.7G 82 Linux
sysadmin@6234a1u:~$ sudo mount -t ntfs /dev/sdb1 /mnt/sata
sysadmin@6234a1u:~$ ls -al /mnt/sata
total 6805
drwxrwxrwx 1 root root    8192 Apr 14 14:11  .
drwxr-xr-x 4 root root    4096 May 22 14:45  ..
drwxrwxrwx 1 root root    4096 Mar  4 21:07 '$RECYCLE.BIN'
-rwxrwxrwx 1 root root    3280 Mar  4 21:07  bootsqm.dat
-rwxrwxrwx 1 root root 3968392 Jan 22  2009  Ghost32.Exe
-rwxrwxrwx 1 root root 2950536 Jan 22  2009  Ghostexp.Exe
drwxrwxrwx 1 root root    8192 Apr 30 09:37  homefolder
drwxrwxrwx 1 root root    4096 May 19 22:00  Lenovo
drwxrwxrwx 1 root root    4096 Dec 20 11:15  Pavillion
drwxrwxrwx 1 root root       0 Feb 16 04:07  R32
-rwxrwxrwx 1 root root     274 Nov 30  2016  rescuepe.log
drwxrwxrwx 1 root root    4096 Jan  5 11:03  Satellite   
drwxrwxrwx 1 root root    4096 Mar  4 21:06 'System Volume Information'                                             
drwxrwxrwx 1 root root       0 Apr 21 12:19  .Trash-111108
sysadmin@6234a1u:~$

Thanks for the help!!
Vance
Title: Re: Not authorized to perform operation
Post by: vance on May 23, 2022, 04:42:28 AM
I have a new revelation.  After a reboot as the simple way to unmount the drive & get things back like they were before the mount I got an error as I logged in.  It said "GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: An authentication agent already exists for the given subject".  I did some research & then went to Menu > Preferences > LXQT settings > Session Settings.  Under Autostart I took the checkmark off Sparky PolicyKit.  After a reboot & logging back in there was no GDBus error.  I still got the error "Not authorized to perform operation" though.  I put the checkmark back on & rebooted again & now I don't get the GDBus error but I still get the "Not authorized to perform operation" error.  Does this give us additional information we can use?
Thanks!!
Vance
Title: Re: Not authorized to perform operation
Post by: pavroo on May 23, 2022, 10:19:37 AM
It happens, becouse you 2 agens have installed now, so uninstall the last one:
sudo apt purge sparky-polkit
sudo apt autoremove
It should remove the lxde polkit as well; then reboot to check it out.
Title: Re: Not authorized to perform operation
Post by: vance on May 24, 2022, 07:51:02 PM
Pavroo, I need to give you an update.  To help me understand what was going on I decided to start from scratch with a new install again.  Once the new install was done I ran the commands you had suggested starting from the top.  The 1st command confirmed that the policy kit package was at /usr/bin/lxqt-policykit-agent.  The next command showed that lxqt-policykit-agent was running as a process because it had a PID number.  The 3rd command showed that the package sparky-polkit wasn't installed so I installed it using synaptic.  This time, as I did the install I noticed that it also installed the package lxpolkit.  I assume with my configuration the OS thinks I need lxpolkit.  If I had used apt when I installed sparky-polkit for you above you would have seen that also.  I think what is confusing policykit is that I have a remote user on the computer with a UID of 111108.  I am using a scripting program called CID to join to an active directory domain.  You can read more information about it at: https://cid-doc.github.io/.  I also now realize there are numerous programs that require sudo access that don't run directly from the menuing system.  Does this give you information you can use to help me figure this out or is it too much information?
Thanks again!!
Vance
Title: Re: Not authorized to perform operation
Post by: pavroo on May 27, 2022, 09:31:18 PM
You do not need sparky-polkit and lxpolkit, as I said before, it was for checking your settings out.
Still don't know why you can't mount the ntfs partition, but I will make such environment on my machine to check it out.
Title: Re: Not authorized to perform operation
Post by: pavroo on May 28, 2022, 12:40:04 AM
Ok, I made such environment with external NTFS partition and... all fine, works and mounts ntfs via pacman-qt with no problem.

So, my suggest is that the 2nd ntfs formatted drive can be broken.
To check it out, simply download any different Linux distribution, such as Ubuntu, Manjaro, openSuse or so, make it bootable from an usb flashdrive, and check can they mount your 2nd drive. You can also use sparky rolling from the live usb as well, for example, but try something other than sparky as first.
Title: Re: Not authorized to perform operation
Post by: vance on May 29, 2022, 02:27:16 AM
Thanks for the help Pavroo.  I'm going into a busy time right now so be patient with me & I'll eventually be able to try your suggestions.  When I have some news I'll let you know.
Thanks so much Pavroo
Title: Re: Not authorized to perform operation
Post by: vance on May 30, 2022, 04:46:19 PM
Pavroo, I'm not sure this will help you understand better what's going on or not.  I reinstalled Sparky & joined to the Active Directory using CID.  I also have to use a theme in SDDM that allows entering the username at login.  After doing all this & before I've been required to authenticate access to anything else I try to go into APTus AppCenter or into Synaptic Package Manager or any other program where authentication is required & regardless of whether I use the identity of vance or my original system user which is named sysadmin it doesn't allow me access to the program.  It doesn't even give me an error.  Instead it just takes me back to the desktop with no other action taken.  To gain access to those programs I have to use a terminal window & use "sudo synaptic-pkexec" for instance to go into Synaptic Package Manager.
Thanks!!!
Vance
Title: Re: Not authorized to perform operation
Post by: vance on May 31, 2022, 06:02:54 AM
Pavroo, with more research I have figured out something that I hope is helpful.  Using Synaptic Package Manager for testing I can go into /usr/share/polkit-1/actions/com.ubuntu.pkexec.synaptic.policy & change the values for <allow_any>, <allow_inactive> & <allow_active> from auth_admin to auth_self.  Before the change when the values are auth_admin Synaptic Package Manager will not start through the GUI.  I can start it through a terminal window using sudo though.  When I change the value in the .policy file to auth_self it still asks me for the password for authentication but of course it's my password although as I installed I told it to use the same password for root (sudo).  I don't know which .policy file I would need to change to make the automatic mount work though.
Another point I need clarification on.  The Sparky install uses PCManFM-Qt for the file manager.  Is that the same thing as what you mentioned above when you said pacman-qt?
Thanks for the continued help Pavroo
Title: Re: Not authorized to perform operation
Post by: vance on May 31, 2022, 06:20:18 AM
With a little more guessing I figured out which file it was.  I changed the org.sparky-fileopen.policy file the same way I did the synaptic file & that allowed me to mount the drive automatically in the file manager.  Is there documentation that tells what each of the 82 .policy files is for?
Thanks!!!!
Vance
Title: Re: Not authorized to perform operation
Post by: vance on May 31, 2022, 06:31:52 AM
I spoke too soon.  I don't think that is the correct .policy file for mounting.
Vance
Title: Re: Not authorized to perform operation
Post by: vance on July 27, 2022, 04:40:21 PM
Pavroo, I walked away from sparkylinux-6.3-x86_64-lxqt & decided to try sparkylinux-2022.07-x86_64-xfce.  It works fine with the 2nd drive in the same configuration as I had before on sparkylinux-6.3-x86_64-lxqt.  I should also let you know I have tried this same configuration on Linux Lite, Q4OS & Debian Bullseye & others with no problem.  On another note, does the default sparkylinux-2022.07-x86_64-xfce have a file search function in it?
Thanks Pavroo!