How can I execute a sudo command by double clicking an icon ( password should be part of the script). Please help! Excuse if question is a blunder. My gnome-ppp is not detecting my BSNL modem when I run w/o sudo command. I would like to make a executable file for the sudo command sudo gnome-ppp.


Instead of hard-coding the password (which is completely insecure, and breaks if you ever change it), you should edit the sudoers file and allow sudo gnome-ppp to be run without a password:

First, check if you're in the adm user group:


This should give you a list of your groups; I chose adm, because that includes users who can administer the system. It may be admin in your case; adjust accordingly.

Now find where gnome-ppp lives:

which gnome-ppp

This will give you the full path; in my case, it's /usr/bin/gnome-ppp

sudo visudo

and add the line at the bottom:

%adm ALL = NOPASSWD: /usr/bin/gnome-ppp

Save the file; now when you call sudo gnome-ppp, you will not be prompted for a password.

  • I was able to open visudo. What should i do type "%adm ALL = NOPASSWD: /usr/bin/gnome-ppp" at bottom of the terminal screen. (How to save and exit) – WANGDU Feb 27 '14 at 14:57
  • Depends on your editor - in vim, it's :wq, in nano, it's Ctrl+X Y Enter – Piskvor Feb 27 '14 at 14:59
  • Mine was nano. And ctr X worked. it was displayed as ^X. I never realized that ^ meant CTRL. Now its working fine. – WANGDU Feb 27 '14 at 15:02
  • 2
    Wonderful. Glad it helped. (^ for Control is an ancient and widespread custom; note that e.g. pressing Ctrl+C shows ^C in terminal) – Piskvor Feb 27 '14 at 15:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.