-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbase_config.sh
executable file
·83 lines (65 loc) · 4.52 KB
/
base_config.sh
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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
#!/bin/bash
# Shut off useless services
services() {
for srv in yum-updatesd cups sendmail bluetooth iptables ip6tables; do
chkconfig --level 123456 ${srv} off
done
}
base_cfg() {
mv /root/.ssh /root/.sshbak
mkdir /root/.ssh
chmod 700 /root/.ssh
cat > /root/.ssh/authorized_keys <<EOF
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAmheUCx1OFo4PECzIsxwZUWvfFDDFxs1H6UpMPEy5rVgYTe5PlytTA7tcZHb01nh/m1m9qQISFVG065UB8XceFvbN3NSSDNT/38ZC0Z5ho9PV20NUOecAn9eRvysFcJqxOPpqLybcVFb0mz8npz7tznBOstyVjm0KTztPKcpvfD8GrklDquoIp6DUwFuAbzqle3vG1jnLzqD/8omu1+1gNJttq0FROmITknnTNptuhV3/BKex5BJFS9O8EOXs7iq+VUQIRAsIQOeVXulaSml1ovXPLSoxZAkCEJanhZLGmOFiEmKaMADz6X4PWEWFcVOa7XAGXRqyhOCJcCCARYm+Kw== [email protected]
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAwx9fYHGPMLJBKjOyAgzer6IU6zyLAWAOEAhsxZejXdZhpOm0pH2VjW1KufY0atgHnQBCv7aMkfGt1BryVGGTKZdUINkX1DxvXYSRmJFgTnrGPsts99mUiTRcGViPSR8x+KdfiwWXsx3rlQoKZ+z3uF/O7/qiqbDzRJA7MkyMT0EhyNTYhlumB8UTJzcCqnkfvE0XAkt8oDVH3hkctqoHWRPyl/NB3QWulboMPwa07IXsPf5KuSe8Q03MmOyTZB5I7Z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YRl08kv7VP/twbeIBey9iZTeHQVd9ibhb0LcaSEjz6m7jfoSN22EvTEMYlGxv0HVyQ== [email protected]
ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAQEAsMvODgIqL1NoUgP65qmgf0sJjQy78QdA5rHw9tIwK5KstVSh+0w4TLHJq8Jz8E4UeXhx0NioP3kE3otjCC8kSM5y99QOs4qQh7q6cLN9hQpXMQUD9UnJMP0b5agd0PdErH0ML9hnWfsZX707v31VSIbco+X6Kg9wN8WJhlTXgbbrJTUIPnMzNXrN7Z5/jY6Vss7NTCVI7OxUbIna37l5y8s4jxViaXjoVEXP8e4QtTX8p0BYc2vgerI04ZilhbIe4KEcHiR+n/GUr6MmkY5qtLum/7IZLHbHfWha1q7VaPnz/CHmlDySxxq4sF81N4x2V7d0+x8/wNZx2d+duJmV0Q== hudson@
EOF
chmod 600 /root/.ssh/*
}
# env config
env_cfg() {
# get rid of silly default aliases
cp -f /root/.bashrc /root/.bashrc_bk
cat > /root/.bashrc <<EOF
# .bashrc
# Source global definitions
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
EOF
# put IP info onto console at boot time
cat > /root/.ip_info.sh <<EOF
#/bin/sh
sleep 10
echo 0 > /selinux/enforce
EOF
# put IP info onto console at boot time
cat > /root/.ip_info.sh <<EOF
#/bin/sh
sleep 10
echo; echo "My IP information" >> /dev/tty1
/sbin/ifconfig | grep "inet addr" >> /dev/tty1
EOF
chmod +x /root/.ip_info.sh
cat >> /etc/rc.local <<EOF
/root/.ip_info.sh &
EOF
}
packages() {
$pkg_cmd install vim
$pkg_cmd install ntp
$pkg_cmd install sysstat
}
###############
# MAIN
###############
if [ -d /selinux ]; then
echo 0 > /selinux/enforce
fi
pkg_cmd=`which yum` || pkg_cmd=`which apt-get`
pkg_cmd=$pkg_cmd" -y"