I am trying to run some shell commands on Linux under electron js that required Root Permissions.
If I run "Sudo electron ." then it works
If I create a build for Linux deb file like
"linux:build": "rm -rf dist && electron-packager . App --platform linux --arch x64 --out dist/ --no-sandbox"
"linux:deb": "electron-installer-debian --src ./dist/App-linux-x64/ --arch amd64 --no-sandbox --config linux.json"
Then Deb file is created, when I installed it then how I can run this app as a root user?
If I try to open this app with sudo App then it throws an error of Running as root without --no-sandbox is not supported. See https://crbug.com/638180
In case of it's run like this, I don't think it's good practice that user will open app like this. How we can create Linux package that uses root permissions?
I also tried with package sudo-prompt and electron-sudo But it asks for admin password again and again as per commands will run. It should be asking for once.
Can anybody help me with this?
Looking forward to hearing from you guys!