Friday, May 3, 2024
 Popular · Latest · Hot · Upcoming
12
rated 0 times [  12] [ 0]  / answers: 1 / hits: 36111  / 2 Years ago, sat, july 2, 2022, 7:25:46

I would like to launch a Gnome application with root privileges at login.



I have tried adding a script to launch using update-rc.d myscript.sh defaults.



It looks like the application does launch, but it is no longer there by the time the gnome gui arrives.



How can I do that?


More From » gnome

 Answers
0

Running graphical things as root is a bad idea for security but I'm going to assume you know that and that you have exhausted any other methods. You need to do two things:




  1. Allow your user to run the command via sudo without a password by editing /etc/sudoers. You can find a brief explanation here but you're looking for something like this:



    username ALL=(ALL:ALL) NOPASSWD:/path/to/command 


    Obviously replace the username and /path/to/command with real values, stick that in there and then try sudo -k /path/to/command (the -k just means it'll ask for your password if it doesn't know any better - it won't ask if your sudoers edit was correct).


  2. Auto-launch your application via the standard "Startup Applications", calling sudo /path/to/command




And that's it.


[#39505] Sunday, July 3, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
beateyra

Total Points: 499
Total Questions: 113
Total Answers: 125

Location: Falkland Islands
Member since Mon, Jul 13, 2020
4 Years ago
;