Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve README.md for Passwordless sudo. #167

Merged
merged 1 commit into from
Jan 20, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,31 @@ end
Passwordless sudo
-----------------

Add the following snippet to the sudoers file (for example, to
```/etc/sudoers.d/vagrant_hostmanager```) to make it stop asking
password when updating hosts file (replace ```/home/user``` with your
actual home directory):
To avoid being asked for the password every time the hosts file is updated,
enable passwordless sudo for the specific command that hostmanager uses to
update the hosts file.

Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp /home/user/.vagrant.d/tmp/hosts.local /etc/hosts
%sudo ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
- Add the following snippet to the sudoers file (e.g.
`/etc/sudoers.d/vagrant_hostmanager`):

```
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp <home-directory>/.vagrant.d/tmp/hosts.local /etc/hosts
%<admin-group> ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
```

Replace `<home-directory>` with your actual home directory (e.g.
`/home/joe`) and `<admin-group>` with the group that is used by the system
for sudo access (usually `sudo` on Debian/Ubuntu systems and `wheel`
on Fedora/Red Hat systems).

- If necessary, add yourself to the `<admin-group>`:

```
usermod -aG <admin-group> <user-name>
```

Replace `<admin-group>` with the group that is used by the system for sudo
access (see above) and `<user-name>` with you user name.

Windows support
---------------
Expand Down