-
Notifications
You must be signed in to change notification settings - Fork 0
/
ks-base.cfg
53 lines (48 loc) · 1.28 KB
/
ks-base.cfg
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Build a basic CentOS 5 AMI
install
cmdline
reboot
cdrom
lang en_US.UTF-8
keyboard us
skipx
network --device eth0 --bootproto dhcp
services --enabled=network
rootpw --iscrypted $1$Wc6Nxljt$LmD0wSpp611tCW90gUBaZ1
firewall --enabled --port=22:tcp
authconfig --enableshadow --enablemd5
selinux --permissive
timezone --utc America/Detroit
bootloader --location=mbr --driveorder=vda
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
#clearpart --linux --drives=vda
clearpart --all --initlabel --drives=vda
part /boot --fstype ext3 --size=100 --ondisk=vda
part swap --size=512
part / --fstype ext4 --size=100 --grow
# disable root login
%post --erroronfail
# disable root password based login
cat >> /etc/ssh/sshd_config << EOF
PermitRootLogin without-password
UseDNS no
EOF
# set up ssh key fetching
cat >> /etc/rc.local << EOF
if [ ! -d /root/.ssh ]; then
mkdir -p /root/.ssh
chmod 700 /root/.ssh
fi
# Fetch public key using HTTP
KEY_FILE=$(mktemp)
curl http://ashee.github.com/id_rsa.pub 2>/dev/null > \$KEY_FILE
if [ \$? -eq 0 ]; then
cat \$KEY_FILE >> /root/.ssh/authorized_keys
chmod 600 /root/.ssh/authorized_keys
fi
rm -f \$KEY_FILE
EOF
%end