mirror of
https://github.com/elasticdog/packer-arch.git
synced 2026-01-23 02:14:40 +00:00
OpenSSL 3.0 removed option `-crypt`. Use `-6` as this option seems unlikely to be removed soon. While at it, quote shell variables in a safe way to prevent issues when they contain space characters. Fixes: https://github.com/elasticdog/packer-arch/issues/80
11 lines
485 B
Bash
11 lines
485 B
Bash
#!/usr/bin/env bash
|
|
|
|
PASSWORD="$(/usr/bin/openssl passwd -6 '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
|
|
/usr/bin/systemctl start sshd.service
|