File tree Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Expand file tree Collapse file tree 1 file changed +24
-6
lines changed Original file line number Diff line number Diff line change @@ -120,13 +120,31 @@ end
120
120
Passwordless sudo
121
121
-----------------
122
122
123
- Add the following snippet to the sudoers file (for example, to
124
- ``` /etc/sudoers.d/vagrant_hostmanager ``` ) to make it stop asking
125
- password when updating hosts file (replace ``` /home/user ``` with your
126
- actual home directory):
123
+ To avoid being asked for the password every time the hosts file is updated,
124
+ enable passwordless sudo for the specific command that hostmanager uses to
125
+ update the hosts file.
127
126
128
- Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp /home/user/.vagrant.d/tmp/hosts.local /etc/hosts
129
- %sudo ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
127
+ - Add the following snippet to the sudoers file (e.g.
128
+ ` /etc/sudoers.d/vagrant_hostmanager ` ):
129
+
130
+ ```
131
+ Cmnd_Alias VAGRANT_HOSTMANAGER_UPDATE = /bin/cp <home-directory>/.vagrant.d/tmp/hosts.local /etc/hosts
132
+ %<admin-group> ALL=(root) NOPASSWD: VAGRANT_HOSTMANAGER_UPDATE
133
+ ```
134
+
135
+ Replace `<home-directory>` with your actual home directory (e.g.
136
+ `/home/joe`) and `<admin-group>` with the group that is used by the system
137
+ for sudo access (usually `sudo` on Debian/Ubuntu systems and `wheel`
138
+ on Fedora/Red Hat systems).
139
+
140
+ - If necessary, add yourself to the `<admin-group>`:
141
+
142
+ ```
143
+ usermod -aG <admin-group> <user-name>
144
+ ```
145
+
146
+ Replace `<admin-group>` with the group that is used by the system for sudo
147
+ access (see above) and `<user-name>` with you user name.
130
148
131
149
Windows support
132
150
---------------
You can’t perform that action at this time.
0 commit comments