summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorBilly O'Mahony <billy.o.mahony@intel.com>2016-04-15 16:27:10 +0100
committerJörgen Karlsson <jorgen.w.karlsson@ericsson.com>2016-04-20 17:58:47 +0000
commitb99dd26ea6a9abae5f226a1141213050efd16e78 (patch)
tree7e15faefd15d2c2f18294361c6dea82b1743f379 /tools
parent11a452a34c345abb7d882b151dd99c536f477650 (diff)
ubuntu_cloud_img: Allow pwd console access
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>
Diffstat (limited to 'tools')
-rwxr-xr-xtools/ubuntu-server-cloudimg-modify.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/tools/ubuntu-server-cloudimg-modify.sh b/tools/ubuntu-server-cloudimg-modify.sh
index 11e6051cd..78bf098dc 100755
--- a/tools/ubuntu-server-cloudimg-modify.sh
+++ b/tools/ubuntu-server-cloudimg-modify.sh
@@ -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