I have to use a home-built tool at my company which requires 'root' privileges.
To make things worse, it's a GUI application. Normally, I wouldn't execute such things, but I don't have much of a choice.
Currently, I am using
xhost + && sudo java -jar servermanager.jar && xhost -
to execute the application. This means though, that for the time java is running, access control to the X-Server is disabled.
Granted, this might not be the worst of security issues, but it still got me wondering whether there is a better timed method to execute xhost -
immediately after the application has opened its X connection.
TL;DR: How can I execute a command right after a GUI window has opened?
binfmt-misc
installed (Linux), you can associate Jar files to their interpreter (and most distros will do that by default). Sochmod +x servermanager.jar
and then you should be able to simply execute./servermanager.jar
. – Toby Speight Feb 18 '16 at 15:11xhost +
? This is not necessary to run an X application as root. See Can I launch a graphical program on another user's desktop as root? – Gilles 'SO- stop being evil' Feb 18 '16 at 21:34