Thunar file manager adds a new function to open the current directory or folder with root privileges

 

Problem background, ordinary users access files of other user groups, but cannot access normally, so there is the following solution

The first solution found

How to add an item "Open current folder with root privileges" in thunar - Ubuntu Chinese Forum

In the thunar explorer, select the menu Edit - "configure custom action "command" and write gksudo thunar %f

Interface style  "file type"  write  *

interface style  "if selected display"  select  "directory"

But here comes the problem, gksudo related components have been eliminated by debian

I continued to read and finally found

Thunar right-click menu and other customization - dylanchu - Blog Park (cnblogs.com)

This article is essentially the same as the previous article, except that the command is replaced by pkexec thunar %f

But there is still a problem, click no response,

Finally, I thought about it, maybe it was rejected by the authorization management component

Enter

cd /usr/share/polkit-1/actions

backup

sudo mv org.xfce.thunar.policy org.xfce.thunar.policy.back

Modify sudo nano org.xfce.thunar.policy

Change the relevant default values ​​to the following

 <defaults>
 <allow_any>auth_admin</allow_any>
 <allow_inactive>auth_admin</allow_inactive>
 <allow_active>auth_admin</allow_active>
 </defaults>

Final Results

 

Guess you like

Origin blog.csdn.net/u013833472/article/details/129924591