spaces in comment break cloud-init disabling of root ssh
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
Medium
|
Unassigned | ||
Precise |
Won't Fix
|
Medium
|
Unassigned | ||
Quantal |
Won't Fix
|
Medium
|
Unassigned | ||
Raring |
Fix Released
|
Medium
|
Unassigned | ||
Saucy |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Under bug 833499 we changed cloud-init to disable keypairs inserted by nova into /root/.
It seems that that disabling is broken if the comment portion of an ssh authorized key entry has a space in it. This is fixed in 13.04 and 13.10, but present in 12.04 and 12.10.
Normally, the comment portion of a keyname.pub entry would not have spaces in it, but those generated by the horizon UI and by 'nova keypair-add' do.
Reproducing the bug is easy enough:
$ ssh-keygen -N '' -C 'My Comment Has Spaces' -f /tmp/testkey -t rsa
$ cat /tmp/testkey.pub
ssh-rsa AAAAB3NzaC1yc2E
$ nova keypair-show mytestkey | grep Public
Public key: ssh-rsa AAAAB3NzaC1yc2E
$ IMAGE_ID=
$ nova boot --key-name=
...
$ ssh -i /tmp/mytestkey root@$IP
I've verified that the following are broken:
ubuntu-
ubuntu-
But that cloud-init inside of these images is resilient:
ubuntu-
ubuntu-
Related bugs:
* bug 833499: virt/disk.py unconditionally inserts public_keys into /root/.
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: cloud-init 0.6.3-0ubuntu1.6
ProcVersionSign
Uname: Linux 3.2.0-52-virtual x86_64
ApportVersion: 2.0.1-0ubuntu17.4
Architecture: amd64
Date: Tue Sep 3 14:25:35 2013
Ec2AMI: ami-0000049a
Ec2AMIManifest: FIXME
Ec2Availability
Ec2InstanceType: m1.tiny
Ec2Kernel: unavailable
Ec2Ramdisk: unavailable
MarkForUpload: True
PackageArchitec
ProcEnviron:
TERM=screen
PATH=(custom, no user)
LANG=en_US.UTF-8
SHELL=/bin/bash
SourcePackage: cloud-init
UpgradeStatus: No upgrade log present (probably fresh install)
Just a comment, if we did change this, we potentially break users of 12.04 who had spaces in their comments and then ssh'd in as root.