35a104c253c79ef7268f2ad2b26408cbb85691bf
[automated-distro-installer] / 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 $target/etc/udev/rules.d/70-persistent-net.rules $target/lib/udev/write_net_rules
15 shred --remove $target/etc/ssh/ssh_host_*
16
17 # FIXME: DHCP RFC3442 is used incorrect in Azure
18 if [ -f $target/etc/dhcp/dhclient.conf ]; then
19 sed -ie 's,rfc3442-classless-static-routes,disabled-\0,' $target/etc/dhcp/dhclient.conf
20 fi