Last active
August 29, 2015 14:02
-
-
Save tmarcus87/4d224b38cc274ae7ea70 to your computer and use it in GitHub Desktop.
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
#!/bin/bash | |
echo "Current iptables => " | |
iptables -L | |
echo "Flush iptables => " | |
iptables -F | |
echo "Save iptables => " | |
service iptables save | |
echo "Modify /etc/ssh/sshd_config" | |
sed -i -e "s:^#PermitRootLogin yes:PermitRootLogin yes:" /etc/ssh/sshd_config | |
sed -i -e "s:^#UseDNS yes:UseDNS no:" /etc/ssh/sshd_config | |
echo "Change to symbolic link." | |
rm /etc/udev/rules.d/70-persistent-net.rules | |
ln -s /dev/null /etc/udev/rules.d/70-persistent-net.rules | |
sed -i -e "s:^SELINUX=enforcing:SELINUX=disabled:" /etc/sysconfig/selinux | |
groupadd vagrant | |
useradd vagrant -g vagrant -G wheel | |
echo "vagrant ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers | |
sed -i -e "s:^.*requiretty:#Defaults requiretty:" /etc/sudoers | |
mkdir -p /home/vagrant/.ssh | |
chmod 0700 /home/vagrant/.ssh | |
curl -L -o /home/vagrant/.ssh/authorized_keys https://raw.githubusercontent.com/mitchellh/vagrant/master/keys/vagrant.pub | |
chmod 0600 /home/vagrant/.ssh/authorized_keys | |
echo "exclude=centos*" >> /etc/yum.conf | |
yum -y update |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment