4

It happens in both Ubuntu 22.04 and Manjaro (Gnome). If I install XRDP on it and connect to it via XRDP, for some apps the sudo password dialogue is working, and for some other apps, it does not work. Why is it so, and is there any way to fix it?

An example of not working app is Nautilus (Files). On Manjaro, the nautilus-admin extension is installed by default, and on Ubuntu, you can install it from the official repository. Now, if you right click a directory in Files and choose "Open as Administrator", it fails in XRDP, because it does not show the sudo password dialogue as it does when doing it locally.

Damn Vegetables
  • 1,187
  • 9
  • 19

2 Answers2

0

This is probably happening due to .xauthority not getting set for the XRDP session. There are a lot of threads regarding this that suggest varying workarounds.

A simple workaround for Debian based systems using .xsessionrc might be applicable.

From https://forums.raspberrypi.com/viewtopic.php?t=286910 :

SUMMARY : To be able to launch graphical apps with root privileges while connected to an Xrdp session, simply create a file named .xsessionrc in your home folder and add to this file the following line :

export XAUTHORITY=${HOME}/.Xauthority

Then restart Xrdp service with the following command :

sudo systemctl restart xrdp.service

I believe you can do this in one line in the terminal:

touch ~/.xsessionrc &&  echo "export XAUTHORITY=\${HOME}/.Xauthority" >> ~/.xsessionrc && sudo systemctl restart xrdp.service
Csnap
  • 186
  • 6
  • This did not work on Ubuntu 22.04. I think the situation is a little bit different. It is not that the sudo dialogue does not work at all, but only for some apps. For example, the sudo dialogue works fine for the "Software & Updates" app when I try to change the "Download from:" drop-down. But it did not work for "Open as Administrator" of `nautilus-admin`. If you have Ubuntu, could you test it by installing `xrdp` and `nautilus-admin`? – Damn Vegetables May 13 '22 at 18:16
0

I'm having the same problem on Linux Lite 6.0 (Ubuntu 22.04 LTS base) and this fix did not work for me either... I have a running Linux Mint 21 box that I can elevate to root via the GUI and xRDP so maybe I'll compare the xRDP settings and see if I can find out anything.

  • I think I have tested it on Cinnamon (but not on Mint) and had the same problem. What DE were you using, Cinnamon? Also, does it work in every case? I mean, even in my case (Gnome), for some apps it works. One of the example of not working cases is typing "admin://" and pressing enter in the address bar of a file manager like Nautilus, Thunar, etc. Try that on your "Mint" computer if that works. – Damn Vegetables Oct 28 '22 at 13:41
  • 1
    This does not provide an answer to the question. Once you have sufficient [reputation](https://unix.stackexchange.com/help/whats-reputation) you will be able to [comment on any post](https://unix.stackexchange.com/help/privileges/comment); instead, [provide answers that don't require clarification from the asker](https://meta.stackexchange.com/questions/214173/why-do-i-need-50-reputation-to-comment-what-can-i-do-instead). - [From Review](/review/late-answers/427319) – John Militer Oct 30 '22 at 20:55