1

I would like to know if there is any way for Java to prompt the user for the administrative password, like what they would use with sudo, so that I can run commands in the Java program without having to do weird stuff with the system or Sudoers. I have seen in done in Python, ie with the program gufw, and I would like to be able to do it with Java.

1 Answers1

0

To act as gufw you must use polkit along with dbus-java. Another possibly simpler solution is to build a command (e.g. "sudo command" and run it with Runtime.getRuntime().exec Doing this can be very dangerous must be done carefully.

LogicG8
  • 1,767
  • 16
  • 26