From ef2f01cbc3cb898e96f96f5be3c414d0ffe40785 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tadej=20Jane=C5=BE?= Date: Tue, 13 Oct 2015 10:53:00 +0200 Subject: [PATCH] Improve README.md for Passwordless sudo. Add information that the usual sudo group on Fedora/Red Hat systems is named 'wheel'. Generalize instructions to make them distribution-agnostic. Add step on adding yourself to the administrator group. --- README.md | 30 ++++++++++++++++++++++++------ 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 81cd9dd..201e50e 100644 --- a/README.md +++ b/README.md @@ -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 /.vagrant.d/tmp/hosts.local /etc/hosts + % ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE + ``` + + Replace `` with your actual home directory (e.g. + `/home/joe`) and `` 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 ``: + + ``` + usermod -aG + ``` + + Replace `` with the group that is used by the system for sudo + access (see above) and `` with you user name. Windows support ---------------