Run bash script from IntelliJ as root
I have a bash script that needs root privileges. I launched it sudo ./script.sh
.
I would like to create a run configuration in IntelliJ IDEA that runs this script with root privileges. It doesn't matter if he asks for a password later.
Is it possible that without running the IDE as root, or with tools like gksudo
or gksu
?
source to share
It was not completely clear which Bash integration you are using. Probably something like a plugin: BashSupport
The runtime configuration window for this plugin does not seem to expose the permission configuration.
Hence, a simple pragmatic solution might actually be to write two scripts.
- You keep your script as is
- Create a second one that calls your current one with sudo
sudo ./myscript.sh
source to share