No ubuntu user, disallow root login, root shell on tty1
Conflicts:
ubuntu-14.04/scripts/base.sh
ubuntu-14.04/template.json
diff --git a/ubuntu-14.04/scripts/base.sh b/ubuntu-14.04/scripts/base.sh
index c1a7a06..841954f 100644
--- a/ubuntu-14.04/scripts/base.sh
+++ b/ubuntu-14.04/scripts/base.sh
@@ -5,8 +5,8 @@
apt-get update
# Cleanup old kernels, ensure latest is installed via virtual package
+apt-get purge -y linux-image-* linux-headers-*
if [ ! -f /tmp/no_install_kernel ]; then
- apt-get purge -y linux-image-* linux-headers-*
apt-get install -y linux-generic-lts-utopic
# Update grub cmdline
diff --git a/ubuntu-14.04/scripts/cleanup.sh b/ubuntu-14.04/scripts/cleanup.sh
index ae0b269..9793e9b 100644
--- a/ubuntu-14.04/scripts/cleanup.sh
+++ b/ubuntu-14.04/scripts/cleanup.sh
@@ -1,4 +1,4 @@
-apt-get -y autoremove
+apt-get -y autoremove --purge
apt-get -y clean
echo "cleaning up guest additions"
diff --git a/ubuntu-14.04/scripts/security.sh b/ubuntu-14.04/scripts/security.sh
new file mode 100644
index 0000000..7dd89b6
--- /dev/null
+++ b/ubuntu-14.04/scripts/security.sh
@@ -0,0 +1,9 @@
+# Auto login root on tty1
+sed -i 's|/sbin/getty|/sbin/getty --autologin root|g' /etc/init/tty1.conf
+
+# Disable password root login
+usermod -p '!' root
+
+# Disable SSH password authentication and permit root login
+sed -i 's|[#]*PasswordAuthentication yes|PasswordAuthentication no|g' /etc/ssh/sshd_config
+sed -i 's|[#]*PermitRootLogin no|PermitRootLogin yes|g' /etc/ssh/sshd_config