weaveworks / footloose

Container Machines - Containers that look like Virtual Machines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Cannot footloose ssh into created nodes if currently in ssh session

seanlowe opened this issue · comments

Getting a error when I try to footloose ssh after running a footloose create on network'd nodes ( I followed the 'Using user-defined networks' example)

Output:

$ cat footloose.yaml 
cluster:
  name: cluster
  privateKey: cluster-key
machines:
- count: 2 
  spec:
    backend: docker
    image: quay.io/footloose/centos7:0.6.3
    name: node%d
    networks:
    - footloose-cluster
    portMappings:
    - containerPort: 22
$ footloose create
INFO[0000] Docker Image: quay.io/footloose/centos7:0.6.3 present locally 
INFO[0000] Creating machine: cluster-node0 ...          
INFO[0000] Connecting cluster-node0 to the footloose-cluster network... 
INFO[0003] Creating machine: cluster-node1 ...          
INFO[0003] Connecting cluster-node1 to the footloose-cluster network... 
$ docker ps -a
CONTAINER ID        IMAGE                             COMMAND             CREATED             STATUS              PORTS                   NAMES
15560dd1b484        quay.io/footloose/centos7:0.6.3   "/sbin/init"        16 seconds ago      Up 13 seconds       0.0.0.0:32773->22/tcp   cluster-node1
1f4010fa3d55        quay.io/footloose/centos7:0.6.3   "/sbin/init"        20 seconds ago      Up 17 seconds       0.0.0.0:32772->22/tcp   cluster-node0
$ footloose ssh root@node1
FATA[0005] exit status 255                              
$ 

Update: I was working this over an ssh session between two nodes on my local network. It seems to not work in an ssh session but if you run the command locally it does work. Updating title to reflect true issue

Edit: Host is running Ubuntu 20.04, ssh node is running Zorin 15.2 Lite. Attempted on a few different configurations (Fedora 31 local, Fedora 31 ssh'd to Ubuntu 18.04, Ubuntu 20.04 ssh'd to Solas 4 Budgie) and all worked. Seems specific to Zorin

$ docker ps
CONTAINER ID        IMAGE                             COMMAND             CREATED             STATUS              PORTS                   NAMES
2ff6502ed07f        quay.io/footloose/centos7:0.6.3   "/sbin/init"        2 hours ago         Up 2 hours          0.0.0.0:32783->22/tcp   cluster-node1
e49d091e2b60        quay.io/footloose/centos7:0.6.3   "/sbin/init"        2 hours ago         Up 2 hours          0.0.0.0:32782->22/tcp   cluster-node0
$ ss -lnt
State                 Recv-Q                 Send-Q                                       Local Address:Port                                    Peer Address:Port                 
LISTEN                0                      128                                          127.0.0.53%lo:53                                           0.0.0.0:*                    
LISTEN                0                      128                                                0.0.0.0:22                                           0.0.0.0:*                                        
LISTEN                0                      128                                                      *:32782                                              *:*                    
LISTEN                0                      128                                                      *:32783                                              *:*                                    
LISTEN                0                      128                                                   [::]:22                                              [::]:*                                    
$ ssh -vvv -i ./cluster-key -p 32782 root@127.0.0.1 
OpenSSH_7.6p1 Ubuntu-4ubuntu0.3, OpenSSL 1.0.2n  7 Dec 2017
debug1: Reading configuration data /etc/ssh/ssh_config
debug1: /etc/ssh/ssh_config line 19: Applying options for *
debug2: resolving "127.0.0.1" port 32782
debug2: ssh_connect_direct: needpriv 0
debug1: Connecting to 127.0.0.1 [127.0.0.1] port 32782.
debug1: Connection established.
debug1: identity file ./cluster-key type 0
debug1: key_load_public: No such file or directory
debug1: identity file ./cluster-key-cert type -1
debug1: Local version string SSH-2.0-OpenSSH_7.6p1 Ubuntu-4ubuntu0.3
ssh_exchange_identification: read: Connection reset by peer
$