Last active
May 6, 2017 13:18
-
-
Save poad/11222085 to your computer and use it in GitHub Desktop.
Vagrant base boxをいちから手動で構築する ref: http://qiita.com/poad1010/items/98672357772350a470ec
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
| 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 |
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
| echo "UseDNS no" | sudo tee -a /etc/ssh/sshd_config |
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
| 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 |
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
| # mount /dev/cdrom /media/cdrom | |
| # sh /media/cdrom/VBoxLinuxAdditions.run |
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
| 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 |
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
| 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