[Lxc-users] Problem ssh-ing into lxc container under Ubuntu 12.04

Fajar A. Nugraha list at fajar.net
Fri Sep 14 14:36:54 UTC 2012


On Fri, Sep 14, 2012 at 9:27 PM, Peter-Frank Spierenburg
<spierepf at hotmail.com> wrote:
> Greetings,
>
> Whenever I try to ssh into an lxc container on Ubuntu 12.04, I get:
>
> ssh_exchange_identification: Connection closed by remote host
>
> using lxc-console to access the container, and checking the
> /var/log/auth.log file:
>
> Sep 14 14:13:47 dnsmasq sshd[174]: fatal: Missing privilege separation
> directory: /var/run/sshd
>
> Fair enough. If I use lxc-console to create /var/run/sshd manually,
> everything is fine. I restart the ssh server and can then ssh in without
> problem...
>
> However, my goal is to build containers automatically using python scripts,
> so navigating the username/password login is too difficult.
>
> Does anyone have any suggestions as to how I can create the /var/run/sshd
> directory inside an lxc container automatically?

How did you create the container? The default ubuntu template on
ubuntu 12.04 should've done the right thing. At least it does last
time I check.

However if you're asking "how do I create a directory instead a
container when I have access to the host", then just do so under the
container's rootfs. By default it's on
/var/lib/lxc/CONTAINER_NAME/rootfs. No need to login into the
container.

-- 
Fajar




More information about the lxc-users mailing list