I want have a script that I can give to friends which will add repositories and download files, install them without having to use command as they are not command line savey and have no desire to learn. I need to know how to get the script to prompt them for the root password to allow them to do some of these functions. How would I go about this? Please don't hate on them.. Getting them to start using Linux was a big step and I am just happy that they are attempting something new... and it was in the open source world..
Just use the
For example, if you are using
If need to make this executable and when you double click there will be a prompt like this
You need to click on Open in terminal button and provide password in the terminal
As Karthick T commented, you can also use the
Double clicking the script will ask the password and run the command after you provided it.
I've had to do this several times, this is a template of my scripts that need to run as root and prompt the user for the root password.
The above is for a specific use case, but I think it highlights two nice features, using
Best of luck!