Skip to content

Instantly share code, notes, and snippets.

@poad
Last active May 6, 2017 13:18
Show Gist options
  • Save poad/11222085 to your computer and use it in GitHub Desktop.
Save poad/11222085 to your computer and use it in GitHub Desktop.
Vagrant base boxをいちから手動で構築する ref: http://qiita.com/poad1010/items/98672357772350a470ec
sudo sed -i -e '/Defaults\s\+env_reset/a Defaults\tenv_keep="SSH_AUTH_SOCK"' /etc/sudoers
sudo sed -i -e '/Defaults\s\+env_reset/a Defaults:vagrant !requiretty' /etc/sudoers
sudo sed -i -e '/Defaults\s\+env_reset/a Defaults\texempt_group=sudo' /etc/sudoers
sudo sed -i -e '/%sudo\s\ALL=(ALL:ALL) ALL/a %vagrant ALL=(ALL) NOPASSWD: ALL' /etc/sudoers
echo "UseDNS no" | sudo tee -a /etc/ssh/sshd_config
mkdir /home/vagrant/.ssh
wget --no-check-certificate 'https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub' -O /home/vagrant/.ssh/authorized_keys
chown -R vagrant /home/vagrant/.ssh
chmod -R go-rwsx /home/vagrant/.ssh
# mount /dev/cdrom /media/cdrom
# sh /media/cdrom/VBoxLinuxAdditions.run
sudo -s
apt autoremove --purge
apt autoclean
e4defrag /
dd if=/dev/zero of=/EMPTY bs=1M; sudo rm -f /EMPTY
find /var/log -type f | while read f; do sudo sh -c "echo -ne '' > $f"; done
exit
rm -rf /var/ww/html
rm ~/.bash_history
sudo sed -i -e 's|/etc/udev/rules.d/70-persistent-net.rules|/dev/null|g' /lib/udev/write_net_rules
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment