Sunday, May 5, 2024
 Popular · Latest · Hot · Upcoming
1
rated 0 times [  1] [ 0]  / answers: 1 / hits: 960  / 2 Years ago, tue, april 12, 2022, 2:52:05

Possible Duplicate:

How do I sudo a command in a script without being asked for a password?






I have a small script file, to run Nautilus as root. that reads:



gksu nautilus 


and it prompts for the root password.



Is there a way to automatically input my password inside the script file?



I know this is not a safe practice, I just want to know if I can do it.


More From » password

 Answers
3

Another way of achieving the same, and one which is much safer. From terminal, run



sudo visudo


At the end of the file, add the following line:



username   ALL = (ALL) NOPASSWD: /usr/bin/nautilus


Replace username by the name of the user who is allowed to run nautilus as root without password (your username, I guess).



From now on, gksudo will not demand a password when you run



gksudo nautilus

[#35991] Thursday, April 14, 2022, 2 Years  [reply] [flag answer]
Only authorized users can answer the question. Please sign in first, or register a free account.
ranquctive

Total Points: 391
Total Questions: 103
Total Answers: 104

Location: South Sudan
Member since Thu, Feb 4, 2021
3 Years ago
ranquctive questions
;