I have an Ubuntu host running Ubuntu lxc containers. Whenever I try to ssh between containers, I get:

root@master02:~# ssh root@slave01 -vvv
OpenSSH_6.6.1, OpenSSL 1.0.1f 6 Jan 2014
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: ssh_connect: needpriv 0
debug1: Connecting to slave01 [] port 22.
debug1: connect to address port 22: Connection refused
ssh: connect to host slave01 port 22: Connection refused

As you can tell, it is not a DNS problem.

If I have a container running centos on the same host, I have ssh into that container just fine.
The container was made with the command: lxc-create -t ubuntu -n slave01
From the host, I am able to attach to slave01 just fine. For an application that I'm working with, I need to ssh between the containers themselves.

I haven't been able to find anything in any log file, either on the host nor the containers.

  • If I'm reading the terminal output, you are trying to ssh from the host to the containers, not between them? Do your containers have ssh server installed and running?
    – Braiam
    Commented Apr 26, 2015 at 22:14
  • Master02 is another container. slave01 has ssh server installed, but it doesn't want to run; no errors, just won't start up.root@slave01:/# /etc/init.d/ssh start root@slave01:/# ps -elf |grep -i ssh 0 S root 208 179 0 80 0 - 2936 pipe_w 16:48 ? 00:00:00 grep --color=auto -i ssh
    – Harlan
    Commented Apr 26, 2015 at 22:48
  • 1
    It looks like your problem has nothing to do with them being containers etc as such - just that sshd isn't starting on slave01. Have a look in /var/log/syslog for an error as ssh tries to start (or failing that run sshd manually and see what happens).
    – Dave C
    Commented Apr 27, 2015 at 0:19

1 Answer 1


Dave C. above is correct about the problem being ssh not running. As I said in a comment, there was not anything in any log file that showed a problem. Stopping/Starting ssh did not have any effect, nor showed any errors anywhere. I just needed to drop the container and build a new one.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .