Merge pull request #167 from tjanez/readme-passwordless-sudo

Improve README.md for Passwordless sudo.
This commit is contained in:
Seth Reeser 2016-01-20 11:00:29 -05:00
commit dcd0351bcd
1 changed files with 24 additions and 6 deletions

View File

@ -120,13 +120,31 @@ end
Passwordless sudo Passwordless sudo
----------------- -----------------
Add the following snippet to the sudoers file (for example, to To avoid being asked for the password every time the hosts file is updated,
```/etc/sudoers.d/vagrant_hostmanager```) to make it stop asking enable passwordless sudo for the specific command that hostmanager uses to
password when updating hosts file (replace ```/home/user``` with your update the hosts file.
actual home directory):
Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp /home/user/.vagrant.d/tmp/hosts.local /etc/hosts - Add the following snippet to the sudoers file (e.g.
%sudo ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE `/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 Windows support
--------------- ---------------