Skip to content

In xrdp, how to run programs as root? #2043

Closed Answered by matt335672
kgfly asked this question in Q&A
Discussion options

You must be logged in to vote

Using sudo to run GUI programs isn't recommended. It might work, but desktop integration isn't what you might expect.

The correct way to do this on a modern desktop is to learn how to use pkexec. If you're on Ubuntu, this post from #1568 should give you all the details you need.

Again, if you're on Ubuntu, you can start with this file as /usr/share/polkit-1/actions/mycorp.apps.disks.policy and edit as required:-

<?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>

<!-- Choose action_id so as not to conflict with anything else -->

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
3 replies
@pelepelin
Comment options

@matt335672
Comment options

@pelepelin
Comment options

Answer selected by matt335672
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants
Converted from issue

This discussion was converted from issue #2042 on November 02, 2021 09:31.