[Lxc-users] Ubuntu sshd template

Gary Ballantyne gary.ballantyne at haulashore.com
Mon Jan 31 23:16:02 UTC 2011


Hi

Would greatly appreciate any help getting the sshd template working on
my Ubuntu 9.1 host.

I can ssh to and from the container and host when the container is
generated by:

lxc-execute -n foo2 -f /usr/share/doc/lxc/examples/lxc/lxc-veth-gb.conf
/bin/bash

Here I have slightly modified the example conf file:

# Container with network virtualized using a pre-configured bridge named
br0 and
# veth pair virtual network devices
lxc.utsname = gb1
lxc.network.type = veth
lxc.network.flags = up
lxc.network.link = br0
lxc.network.ipv4 = 10.89.233.15/24

Also, I can create a sshd template using "./lxc-sshd create" (ip =
10.89.233.13/24).

However, the container doesn't appear to start (or, at least, persist)
with the suggested command:

# lxc-execute -n sshd /usr/sbin/sshd &
[1] 7612
# lxc-info -n sshd                  'sshd' is STOPPED
[1]+  Exit 139                lxc-execute -n sshd /usr/sbin/sshd

But, I can start the container with:

# lxc-start -n sshd &
[1] 7623
# lxc-info -n sshd
'sshd' is RUNNING

And I can ping the container:

root at haulashore1:/usr/share/doc/lxc/examples# ping 10.89.233.13
PING 10.89.233.13 (10.89.233.13) 56(84) bytes of data.
64 bytes from 10.89.233.13: icmp_seq=1 ttl=64 time=9.81 ms
64 bytes from 10.89.233.13: icmp_seq=2 ttl=64 time=0.049 ms

But, I can't ssh to the container:

# ssh 10.89.233.13
ssh: connect to host 10.89.233.13 port 22: Connection refused

(And, I can't connect with lxc-console)

# lxc-console -n sshd
lxc-console: failed to connect to the tty service

Thanks in advance,

Gary






More information about the lxc-users mailing list