-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathvagrant-user-data
21 lines (15 loc) · 975 Bytes
/
vagrant-user-data
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
#!/bin/bash
set -e
VAGRANT_PUBKEY='ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEA6NF8iallvQVp22WDkTkyrtvp9eWW6A8YVr+kz4TjGYe7gHzIw+niNltGEFHzD8+v1I2YJ6oXevct1YeS0o9HZyN1Q9qgCgzUFtdOKLv6IedplqoPkcmF0aYet2PkEDo3MlTBckFXPITAMzF8dJSIFo9D8HfdOV0IAdx4O7PtixWKn5y2hMNG0zQPyUecp4pzC6kivAIhyfHilFR61RGL+GPXQ2MWZWFYbAGjyiYJnAmCP3NOTd0jMZEnDkbUvxhMmBYSdETk1rRgm+R4LOzFUGaHqHDLKLX+FIPKcF96hrucXzcWyLbIbEgE98OHlnVYCzRdK8jlqm8tehUc9c9WhQ== vagrant insecure public key'
VAGRANT_USER=vagrant
VAGRANT_PASS='$6$aSrbQftI$Q/Yk7xI0E4eNV58cRuvjqOHGXS.99BLU19QuJ5M.4X2.tTNSke2J9Cu6kf8fjegq0f1hk/MU8x/RR.TFy3nW50' # password: vagrant
useradd -p "$VAGRANT_PASS" $VAGRANT_USER
echo "$VAGRANT_USER ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
echo "Defaults:$VAGRANT_USER !requiretty" >> /etc/sudoers
cd /home/$VAGRANT_USER
mkdir -p .ssh
echo "$VAGRANT_PUBKEY" > .ssh/authorized_keys
chmod 0600 .ssh/authorized_keys
chmod 0700 .ssh
chown -R $VAGRANT_USER:$VAGRANT_USER .ssh
exit 0