ubuntu_cloud_img: Allow pwd console access 57/12357/2
authorBilly O'Mahony <billy.o.mahony@intel.com>
Fri, 15 Apr 2016 15:27:10 +0000 (16:27 +0100)
committerJörgen Karlsson <jorgen.w.karlsson@ericsson.com>
Wed, 20 Apr 2016 17:58:47 +0000 (17:58 +0000)
Currently if there is a port bind failure it is impossible to access a
VM based on Ubuntu server cloud image to debug.

This change allows access on the console for user ubuntu by was of a
password that is printed to the console during start up; The same way as
VMs based on the cirros image do.

Change-Id: Iac242ba1f3f14ae77a7b00cf2befd6fa4b65af09
Signed-off-by: Billy O'Mahony <billy.o.mahony@intel.com>
Reviewed-by: Ana Cunha <ana.cunha@ericsson.com>
Reviewed-by: Jorgen Karlsson <jorgen.w.karlsson@ericsson.com>
Reviewed-by: Jonas Bjurel <jonas.bjurel@ericsson.com>
Reviewed-by: Daniel Smith <daniel.smith@ericsson.com>
Reviewed-by: Mark D. Gray <mark.d.gray@intel.com>
tools/ubuntu-server-cloudimg-modify.sh

index 11e6051..78bf098 100755 (executable)
@@ -35,8 +35,12 @@ grep trusty /etc/apt/sources.list && \
 echo 'Acquire::ForceIPv4 "true";' > /etc/apt/apt.conf.d/99force-ipv4
 
 # Add hostname to /etc/hosts.
+# Allow console access via pwd
 cat <<EOF >/etc/cloud/cloud.cfg.d/10_etc_hosts.cfg
 manage_etc_hosts: True
+password: RANDOM
+chpasswd: { expire: False }
+ssh_pwauth: True
 EOF
 
 apt-get update