diff --git a/SWSCloudNode/qemu/__init__.py b/SWSCloudNode/qemu/__init__.py index a7b972c..7e85003 100644 --- a/SWSCloudNode/qemu/__init__.py +++ b/SWSCloudNode/qemu/__init__.py @@ -201,11 +201,13 @@ class QEMU: "--rootsize=%s" % storage, "--swapsize=%s" % swap, "--templates=/tmp/libvirt/%s/templates/libvirt" % vm_id, - "--user=ubuntu", + # "--user=ubuntu", # "--name=administrator", - "--pass=%s" % password, + # "--pass=%s" % password, + # "--ssh-user-key=/tmp/libvirt/%s/authorized_keys" % vm_id, + "--lock-user", "--rootpass=%s" % password, - "--ssh-user-key=/tmp/libvirt/%s/authorized_keys" % vm_id, + "--ssh-key=/tmp/libvirt/%s/authorized_keys" % vm_id, "--addpkg=linux-image-generic", "--addpkg=vim-nox", "--addpkg=nano", diff --git a/vm/firstboot.sh b/vm/firstboot.sh index d98ca93..818a8c0 100644 --- a/vm/firstboot.sh +++ b/vm/firstboot.sh @@ -1,10 +1,13 @@ -#firstrun.sh +#!/bin/bash # This script will run the first time the virtual machine boots # It is ran as root. # Expire the user account -passwd -e administrator +# passwd -e administrator + +# Remove default `ubuntu` user +deluser --remove-home --remove-all-files ubuntu # Install openssh-server apt-get update @@ -13,3 +16,6 @@ apt-get install -qqy --force-yes openssh-server locale-gen en_US.UTF-8 locale-gen ru_RU.UTF-8 locale-gen + +# remove file firstboot.sh +rm -f /root/firstboot.sh /root/firstboot_done