Last active
May 24, 2016 11:49
-
-
Save MetalArend/50726742755ceff464afe77ecea17c84 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#!/usr/bin/env bash | |
# thanks to https://lists.debian.org/debian-user/2012/03/msg01962.html | |
exec >>/home/vagrant/bootstrap.out 2>&1 | |
set -x | |
echo "UseDNS no" >> /etc/ssh/sshd_config | |
echo "127.0.0.1 ubuntu-16.04-server-amd64" >> /etc/hosts | |
mkdir -p /home/vagrant/.ssh | |
wget https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub -O /home/vagrant/.ssh/authorized_keys | |
chmod 755 /home/vagrant/.ssh | |
chmod 644 /home/vagrant/.ssh/authorized_keys | |
chown -R vagrant:vagrant /home/vagrant/.ssh | |
echo 'Defaults:vagrant !requiretty' > /etc/sudoers.d/vagrant | |
echo '%vagrant ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers.d/vagrant | |
chmod 440 /etc/sudoers.d/vagrant | |
sed -i 's/PermitRootLogin yes/PermitRootLogin no/g' /etc/ssh/sshd_config | |
sed -i 's/#PasswordAuthentication yes/PasswordAuthentication no/g' /etc/ssh/sshd_config | |
rm /etc/udev/rules.d/70-persistent-net.rules | |
sed -i 's/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX="net.ifnames=0 biosdevname=0"/g' /etc/default/grub | |
update-grub | |
aptitude clean | |
dd if=/dev/zero of=/EMPTY bs=1M | |
rm -f /EMPTY | |
exit 0 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment