Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

michaellindahl's avatar

Homestead asking for administrator privileges/password

I've installed and destroyed Homestead several times without issue. However, after this last time when calling homestead up it asked me for the admin password. I tried vagrant and homestead to no avail. What should I do to fix this?

==> default: Preparing to edit /etc/exports. Administrator privileges will be required...

WARNING: Improper use of the sudo command could lead to data loss
or the deletion of important system files. Please double-check your
typing when using sudo. Type "man sudo" for more information.

To proceed, enter your password, or type Ctrl-C to abort.

Password:
Sorry, try again.
0 likes
4 replies
shez1983's avatar

can you do vagrant up instead? and see what happens? not sure why that would be different but try anyway

michaellindahl's avatar

This is weird. homestead up is an alias for cd ~/.composer/vendor/laravel/homestead/; vagrant up. When I call these either of these two commands the shortcut or the expanded version I run into the aforementioned issue. However, if I just call vagrant up from the homestead directory, already cding into it, it runs as expected with no issues. I'm baffled.

matthias.hertel's avatar

hi there,

yes u have to attach the lines below at the end of the /etc/sudoers - file

Cmnd_Alias VAGRANT_EXPORTS_ADD = /usr/bin/tee -a /etc/exports
Cmnd_Alias VAGRANT_NFSD = /sbin/nfsd restart
Cmnd_Alias VAGRANT_EXPORTS_REMOVE = /usr/bin/sed -E -e /*/ d -ibak /etc/exports
%admin ALL=(root) NOPASSWD: VAGRANT_EXPORTS_ADD, VAGRANT_NFSD, VAGRANT_EXPORTS_REMOVE

be sure that these lines are at the end of this file ... otherwise it would be overwritten

Please or to participate in this conversation.