forked from bbaassssiiee/controller
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
41e646b
commit 6fa6687
Showing
2 changed files
with
22 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/bin/bash | ||
/usr/sbin/groupadd vagrant | ||
/usr/sbin/useradd vagrant -g vagrant -G wheel -d /home/vagrant -c "vagrant" | ||
echo "vagrant" | passwd --stdin vagrant | ||
echo "installing ssh-key for vagrant" | ||
(cd /home/vagrant && mkdir -pm 700 .ssh) | ||
|
||
# This ssh is replaced in 'vagrant up' if the Vagrantfile has `config.ssh.insert_key = true`` | ||
cat > /home/vagrant/.ssh/authorized_keys <<EOF | ||
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key | ||
EOF | ||
chmod 0600 /home/vagrant/.ssh/authorized_keys | ||
chown -R vagrant:vagrant /home/vagrant/.ssh | ||
restorecon -R -v /home/vagrant/.ssh | ||
# allow vagrant user to run everything without a password | ||
echo 'vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant | ||
chmod 0440 /etc/sudoers.d/vagrant |