cannot log into trusty ubuntu-cloud based LXC containers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
openssh (Ubuntu) |
Expired
|
Undecided
|
Unassigned |
Bug Description
freenode #ubuntu-server pointed me to create the bug here. Not sure if it belongs here or elsewhere.
Create a container like so:
$ sudo lxc-create -t ubuntu-cloud -n base -- -S ~/.ssh/id_rsa.pub -r trusty
Start it:
$ sudo lxc-start -d -n base
Attach to the container:
$ sudo lxc-attach -n base
Try to login (fails with too many authentication errors):
$ ssh -i ~/.ssh/id_rsa ubuntu@`dig @10.0.3.1 base` -v
Look at logs (/var/log/auth.log) on attached container and see:
- error: Could not load host key: /etc/ssh/
Work around by manually creating key:
$ sudo /usr/bin/ssh-keygen -t ed25519 -f /etc/ssh/
$ sudo service ssh restart
Login now works.
System info:
$ lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 14.04 LTS
Release: 14.04
Codename: trusty
OpenSSH version: OpenSSH_6.6p1 Ubuntu-2ubuntu1, OpenSSL 1.0.1f 6 Jan 2014
LXC version: 1.0.3
description: | updated |
description: | updated |
Changed in openssh (Ubuntu): | |
status: | New → Confirmed |
affects: | lxc → openssh (Ubuntu) |
I can also confirm that this affects the Vagrant box located at: http:// cloud-images. ubuntu. com/vagrant/ trusty/ current/ trusty- server- cloudimg- amd64-vagrant- disk1.box
After first boot up running 'sudo sshd -t' generates the error:
Could not load host key: /etc/ssh/ ssh_host_ ed25519_ key
If `vagrant reload` is run before the key is generated by hand, then the VM will become unresponsive as the SSH daemon will not start. Generating the key manually prior to first reboot works around the issue.