Created
December 29, 2009 17:52
-
-
Save barinek/265462 to your computer and use it in GitHub Desktop.
aws base package
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
#!/bin/sh | |
yum install -y wget ntp | |
source "/var/spool/ec2/meta-data.sh" | |
echo "$EC2_LOCAL_IPV4 $HOST_NAME" >> /etc/hosts | |
hostname $HOST_NAME | |
echo "HOSTNAME=$HOST_NAME" >> /etc/sysconfig/network | |
mkdir /mnt/tmp | |
chmod 1777 /mnt/tmp | |
modprobe capability | |
/etc/init.d/ntpd start | |
mv /opt /mnt | |
ln -s /mnt/opt /opt | |
mv /home /mnt | |
ln -s /mnt/home /home | |
useradd -m -G wheel -p $USER_PASSWORD barinek | |
mkdir /home/barinek/.ssh | |
mv $ATTACH_DIR/id_rsa.pub /home/barinek/.ssh/authorized_keys | |
chown -R barinek:barinek /home/barinek/.ssh | |
chmod 0600 /home/barinek/.ssh/authorized_keys | |
mv $ATTACH_DIR/sudoers /etc/sudoers | |
chmod 0440 /etc/sudoers | |
head --lines=-1 /etc/ssh/sshd_config > /tmp/sshd_config | |
echo "PermitRootLogin no" >> /tmp/sshd_config | |
mv -f /tmp/sshd_config /etc/ssh/sshd_config | |
/usr/sbin/usermod -p $ROOT_PASSWORD root | |
/etc/init.d/sshd restart |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment