HI,
I’m trying to create an ubuntu 16.04
appliance just as I did with ubuntu 14.04
and so far I’m not having any luck. The ONE contextualization seems to be able to install the ssh key but not in /home/ubuntu/.ssh/authorized_keys
but under the root user. The weird thing is that under 14.04 the key is correctly installed under the ubuntu user. Can anyone point me to some information on how to accomplish this under 16.04?
We are running version 4.14.2 from the official Opennebula repo’s on a Centos 7.2 server.
This is the contextualization template I’m using:
{ "CONTEXT" : {
"NETWORK" : "YES",
"USERNAME": "ubuntu",
"SSH_PUBLIC_KEY" : "$USER[SSH_PUBLIC_KEY]",
"START_SCRIPT" : "apt-get update && apt-get dist-upgrade -y"
},
"CPU" : "1",
"FEATURES" : {
"ACPI" : "yes",
"LOCALTIME" : "no"
},
"GRAPHICS" : {
"LISTEN" : "0.0.0.0",
"TYPE" : "vnc"
},
"NIC" : {
"NETWORK" : "xxx",
"NETWORK_UNAME" : "xxx"
},
"LOGO" : "images/logos/ubuntu.png",
"MEMORY" : "1024",
"OS" : {
"ARCH" : "x86_64"
},
"VCPU" : "1"
}
From within the VM this is what the context.sh script looks
# cat /mnt/context.sh
# Context variables generated by OpenNebula
DISK_ID='1'
ETH0_DNS='8.8.8.8 8.8.4.4'
ETH0_GATEWAY='xxx.xxx.xxx.xxx'
ETH0_IP='xxx.xxx.xxx.xxx'
ETH0_MAC='04:00:91:64:3b:cb'
ETH0_MASK='255.255.252.0'
ETH0_NETWORK='xxx.xxx.xxx.xxx'
NETWORK='YES'
SSH_PUBLIC_KEY='ssh-rsa xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx'
TARGET='hda'
USERNAME='ubuntu'
And to be sure that we have the ubuntu user:
root@packer-ub1604:/etc# cat /etc/passwd | grep ubuntu
ubuntu:x:1000:1000:Ubuntu User,,,:/home/ubuntu:/bin/bash
root@packer-ub1604:/etc# cat /etc/group | grep ubuntu
adm:x:4:syslog,ubuntu
cdrom:x:24:ubuntu
sudo:x:27:ubuntu
dip:x:30:ubuntu
plugdev:x:46:ubuntu
ubuntu:x:1000:
lpadmin:x:111:ubuntu
sambashare:x:112:ubuntu