Change vagrant user pasword with passwd explicitly

Signed-off-by: Hiroshi Hatake <cosmo0920.oucc@gmail.com>
This commit is contained in:
Hiroshi Hatake 2021-11-02 14:16:35 +09:00 committed by Aaron Bull Schaefer
parent 6f332c96cb
commit c7a37bcd18

View file

@ -4,6 +4,7 @@ PASSWORD=$(/usr/bin/openssl passwd -crypt 'vagrant')
# Vagrant-specific configuration
/usr/bin/useradd --password ${PASSWORD} --comment 'Vagrant User' --create-home --user-group vagrant
echo -e 'vagrant\nvagrant' | /usr/bin/passwd vagrant
echo 'Defaults env_keep += "SSH_AUTH_SOCK"' > /etc/sudoers.d/10_vagrant
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/10_vagrant
/usr/bin/chmod 0440 /etc/sudoers.d/10_vagrant