update to 5.4
[automated-distro-installer] / fai / config / scripts / CLOUD / 99-cleanup
1 #! /bin/bash
2
3 fcopy /etc/init.d/expand-root
4 if [ -f $target/files/etc/init.d/expand-root ]; then
5 $ROOTCMD insserv --default expand-root
6 fi
7
8 sed -i "s/PermitRootLogin yes/PermitRootLogin without-password/" $target/etc/ssh/sshd_config
9 ainsl /etc/ssh/sshd_config 'ClientAliveInterval 120'
10
11 ainsl -a /etc/modprobe.d/blacklist.conf 'blacklist pcspkr'
12 ainsl -a /etc/modprobe.d/blacklist.conf 'blacklist floppy'
13
14 rm -f $target/etc/resolv.conf \
15 $target/etc/udev/rules.d/70-persistent-net.rules \
16 $target/lib/udev/write_net_rules \
17 $target/etc/mailname \
18 $target/var/lib/dbus/machine-id
19
20 > $target/etc/machine-id
21
22 shred --remove $target/etc/ssh/ssh_host_*
23
24 # FIXME: DHCP RFC3442 is used incorrect in Azure
25 if [ -f $target/etc/dhcp/dhclient.conf ]; then
26 sed -ie 's,rfc3442-classless-static-routes,disabled-\0,' $target/etc/dhcp/dhclient.conf
27 fi