I'm trying to port a script to Ubuntu 18.04 that uses gksudo to prompt the user for admin password in order to run a GUI program with the admin permissions.
Now, gksudo has been removed from Ubuntu 18.04 and I understand that gvfs with the admin backend is the recommended alternative (as described in this article and elsewhere).
However, I am having trouble running it (My current environment is 16.04, haven't tried on 18.04 yet)

:~$ ls -l /home/luke/test
-rw--w---- 1 root root 22 Jan 23 10:36 /home/luke/test
:~$ gedit admin:///home/luke/test
** (gedit:32552): WARNING **: The specified location is not supported

gedit itself runs, saying:

Could not open the file “admin:///home/luke/test”.
Unable to handle “admin:” locations

Trying to run nautilus fails similarly.
How do I use gvfs to launch an X program with super user permissions?

  • identical behaviour with $USER or the actual hardcoded path. The hardcoded path is what I tried first. edited question to remove this complication. – ezekiel Jan 23 '19 at 12:35
  • I found gvfs-backends as source of this error in a far past... did you installed them? BTW good luck. – Hastur Jan 23 '19 at 12:42
  • thanks for suggestion - yes I had that installed already. – ezekiel Jan 23 '19 at 12:43
  • Where exactly did you try running this command line? I’d guess this only works in “GNOME-y” locations—where GVFS is supported in the first place. – Daniel B Jan 23 '19 at 12:57
  • I'm not sure what you mean by "GNOME-y" locations. I'm running it with gnome-terminal in the same folder as the file - /home/luke/ – ezekiel Jan 23 '19 at 14:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.