[Solved] Running Program Without Administrator Password

All Gurus once were Newbies
Forum rules
There are no such things as "stupid" questions. However if you think your question is a bit stupid, then this is the right place for you to post it. Please stick to easy to-the-point questions that you feel people can answer fast. For long and complicated questions prefer the other forums within the support section.
Before you post please read how to get help
Post Reply
Ian Johnson
Level 1
Level 1
Posts: 10
Joined: Fri Dec 19, 2014 11:02 am

[Solved] Running Program Without Administrator Password

Post by Ian Johnson »

I use the Mullvad VPN which comes with its own software to connect to the network. I added the Mullvad software to my Preferences->Startup Applications so it runs automatically when I log in, but every time it starts Mint shows the "Enter your password to perform administrative tasks" dialog box, and I have to enter my password. This is somewhat inconvenient, so I'd like to be able to run the Mullvad software without having to enter my password.

I'm new to Linux so I'm not really sure what I'm asking for. Presumably the Mullvad software changes some of the network settings so Mint requires me to enter the administrator password, so I'm wondering if there's some way to set up Mint so that a particular program can run without needing the administrator password?

I'm using Linux Mint 17 Cinnamon.

Thanks for any help you can offer with this.
Last edited by Ian Johnson on Fri Dec 19, 2014 7:04 pm, edited 1 time in total.

User avatar
xenopeek
Level 24
Level 24
Posts: 24273
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Running Program Without Administrator Password

Post by xenopeek »

What administrative programs you are allowed to run is controlled in the sudoers configuration file. By default, the user created during installation of Linux Mint is a local administrator that is allowed to run all administrative programs with sudo by providing their own password to authenticate. You can configure it to not require you to authenticate, for a specific program (like you want) or for all programs.

This may be a bit of a hurdle if you're new to Linux, but here is an example of the steps to configure that: http://forums.linuxmint.com/viewtopic.p ... 43#p798353. You'd have to find out the full path to the Mullvad executable's full path and configure that for your username to be allowed to be run without requiring a password.

Instead of the line added to the sudoers file in the linked example, you'd use a line like:

Code: Select all

stumpy ALL=NOPASSWD:/usr/bin/mintinstall
The addition of "NOPASSWD:" makes it so you can run the specified program with sudo without needing to authenticate with your password.
Image

Ian Johnson
Level 1
Level 1
Posts: 10
Joined: Fri Dec 19, 2014 11:02 am

Re: Running Program Without Administrator Password

Post by Ian Johnson »

Thanks a lot for the reply. It seemed simple enough, but I appear to be doing something wrong.

To get the path of the Mullvad program I used the command which mullvad which said it was at /usr/bin/mullvad. I then used the sudo visudo command, which brought up the etc/sudoers.tmp file. At the end of the file I added the line: ian ALL=NOPASSWD:/usr/bin/mullvad and pressed Ctrl+O to save the file and saved as etc/sudoers.tmp. I thought that would be it, but even after restarting the computer it still asks for my password when I run Mullvad.

One thing that appeared wrong was that the visudo command opens etc/sudoers.tmp while the man page says, "The policy is driven by the /etc/sudoers file". I tried saving the file again, but this time removing the .tmp so it saved as etc/sudoers. Sadly, this didn't resolve the problem (hopefully I didn't break anything with that).

In nemo I looked in /user/bin and there is a mullvad file there. It doesn't have an arrow on the icon so it doesn't appear to be a shortcut/symbolic link, so I think /usr/bin/mullvad is the right path for the Mullvad executable. I'm therefore not sure what I'm doing wrong.

Any ideas?

User avatar
WharfRat
Level 21
Level 21
Posts: 13733
Joined: Thu Apr 07, 2011 8:15 pm

Re: Running Program Without Administrator Password

Post by WharfRat »

Ian,

You should copy the sudoers file to sudoers.save just in case. I've had that file complain before and had to copy the saved file back.

Take a look at /etc/sudoers.d/mintupdate and the README. Fashion your Mullvad VPN accordingly e.g. alias VPNCONNECT etc.

And make sure you read the README as there are requirements for files in that folder.

Good luck :wink:
ImageImage

User avatar
xenopeek
Level 24
Level 24
Posts: 24273
Joined: Wed Jul 06, 2011 3:58 am
Location: The Netherlands

Re: Running Program Without Administrator Password

Post by xenopeek »

Change the startup entry for Mullvad to have this command: gksudo /usr/bin/mullvad. That may be needed to pre-authenticate, and apply the configuration done in the sudoers file. Try that command from the terminal to see if it works.
Image

Ian Johnson
Level 1
Level 1
Posts: 10
Joined: Fri Dec 19, 2014 11:02 am

Re: Running Program Without Administrator Password

Post by Ian Johnson »

Thanks a lot for the advice. Running it with gksudo solves the problem and it now starts up without asking for a password.

The only sight problem is that running with gksudo causes the window to appear without a theme applied, but I found a solution to that in the comments here.

Thanks again for all your help.

Post Reply

Return to “Newbie Questions”