I am using an application called Hostbuddy to manage entries in my hosts file. It works great, the only problem is that is asks for my password every time I use it, which adds up to a lot of inconvenience. How can I permanently give Hostbuddy the permission it needs? The two things it asks for the password for are to modify the hosts file and to flush my DNS cache.

PS, I understand the security implications of this, and I trust the app.

1 Answer 1


I do not think this is the app that requires the password, but the host file itself. The host file is owned by root and requires a password to edit. Hostbuddy is probably just requesting the password in order to modify the file. A way to fix this would be to take ownership of the file (not recommended due to security reasons). Another way would be to run Hostbuddy as administrator (but I believe this requires a password anyway just to start it).

If you for some reason want to take the security risk for convenience you should take ownership of the host file OR run Hostbuddy as administrator.


In order to achieve this I believe you must set the setuid bit on the application. To do so I suggest making a new user group that only you are in and using that to gain root access to the app. To do this start by opening System Preferences and going to Users and Groups. You are going to want to make a new group by selecting the '+' button at the bottom left of the window. Go ahead and create a new group by the name 'HostBuddy' Without the quotes like so:

Creating a new group.

Next you need to set yourself as a member of this group like so:

How to add yourself to a group.

Finally we need to do some work within the terminal. Go ahead and open up Terminal.app and navigate to where HostBuddy is (probably /Applications) like so:

Changing to applications folder: cd /Applications

After doing this we set the setuid bit for the application itself under your group name and set permissions with two more commands like this (remember it is cAsE SenSiTIve!):

sudo chown root:HostBuddy hostbuddy.app; sudo chmod 4750 hostbuddy.app

This should allow you to click and run the app as root without needing a password. Since we added a group to the mix this also means other users on your computer do not have that privilege. They must enter a password each time. Only your particular user (or others in the HostBuddy group) get a password-free experience.

  • Thanks. Can anyone help me figure out how to run an app as administrator from the icon, without requiring a password every time? Is this possible? Feb 6, 2014 at 18:58
  • I went ahead and added a tutorial. Tell me if it works out for you! Feb 6, 2014 at 19:37
  • Thanks. I followed the tutorial exactly, but Hostbuddy still asks for the password every time I try to modify the hosts file or flush the cache. Feb 8, 2014 at 10:51
  • 1
    bruh @JosiahSprague i figured it out! use -R to execute the commands recursively i.e. sudo chown -R.... sudo chmod -R and put a trailing slash after .app/ Apr 8, 2017 at 20:59
  • just to be perfectly clear here, the commands in sequence are sudo chown -R root:HostBuddy hostbuddy.app/ sudo chmod -R 4750 hostbuddy.app/ Jul 14, 2017 at 18:13

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .