Ubuntu pkexec调用其他文件(递归)

Ubuntu pkexec调用其他文件(递归),ubuntu,sudo,gksudo,Ubuntu,Sudo,Gksudo,我试图使用pkexec作为Ubuntu 20.04中gksudo的替代方案,在Ubuntu 20.04中,当执行其他文件时,root权限需要保留 我有一个file.sh可以调用32bit/file32.sh或64bit/file64.sh,但当他进入32bit或64bit文件夹时,他失去了继续的权限。有人能帮我写正确的pkexec文件来做这件事吗 我的pkexec到file.sh是: <?xml version="1.0" encoding="UTF-8&qu

我试图使用
pkexec
作为Ubuntu 20.04中
gksudo
的替代方案,在Ubuntu 20.04中,当执行其他文件时,root权限需要保留

我有一个
file.sh
可以调用
32bit/file32.sh
64bit/file64.sh
,但当他进入32bit或64bit文件夹时,他失去了继续的权限。有人能帮我写正确的pkexec文件来做这件事吗

我的
pkexec
file.sh
是:

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE policyconfig PUBLIC
 "-//freedesktop//DTD PolicyKit Policy Configuration 1.0//EN"
 "http://www.freedesktop.org/standards/PolicyKit/1/policyconfig.dtd">
<policyconfig>
    <action id="org.freedesktop.policykit.pkexec.fileA">
    <description>Run root program</description>
    <message>Authentication is required to run root program</message>
    <icon_name>network-transmit-receive</icon_name>
    <defaults>
        <allow_any>auth_admin</allow_any>
        <allow_inactive>auth_admin</allow_inactive>
        <allow_active>yes</allow_active>
    </defaults>
    <annotate key="org.freedesktop.policykit.exec.path">/home/user/Downloads/folderA/file.sh</annotate>
    <annotate key="org.freedesktop.policykit.exec.allow_gui">true</annotate>
    </action>
</policyconfig>

运行根程序
运行根程序需要身份验证
网络收发
授权管理员
授权管理员
对
/home/user/Downloads/folderA/file.sh
真的