anthill / 6brain

0 stars 3 forks source link

Updater #60

Closed vallettea closed 8 years ago

vallettea commented 8 years ago

when we start an update the reverse tunnel opens, but after on pheromon there is this error:

admin client data received
========== starting update for sensors : [ '89332401000001798152' ] ==========
========== using playbook : /pheromon/updateFiles/example.yml ==========
Sending opentunnel to 89332401000001798152 (1/1)
opentunnel 2200 22 sensorSSH@kerrigan
========== Starting to update [ '172.17.42.1:2200' ] ==========
Maestro received: cmdResult 89332401000001798152 undefined
Maestro received: status 89332401000001798152 client

PLAY [all] ********************************************************************

GATHERING FACTS ***************************************************************

<172.17.42.1> ESTABLISH CONNECTION FOR USER: root

<172.17.42.1> REMOTE_MODULE setup

<172.17.42.1> EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=2200 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 172.17.42.1 /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python'

latest output updated
client status data updated for sensor
fatal: [172.17.42.1] => SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh

TASK: [create a file] *********************************************************

FATAL: no hosts matched or all hosts have already failed -- aborting

PLAY RECAP ********************************************************************

           to retry, use: --limit @/root/example.retry

172.17.42.1                : ok=0    changed=0    unreachable=1    failed=0

[Error:
PLAY [all] ********************************************************************

GATHERING FACTS ***************************************************************
<172.17.42.1> ESTABLISH CONNECTION FOR USER: root
<172.17.42.1> REMOTE_MODULE setup
<172.17.42.1> EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=2200 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 172.17.42.1 /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python'
fatal: [172.17.42.1] => SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh

TASK: [create a file] *********************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/root/example.retry

172.17.42.1                : ok=0    changed=0    unreachable=1    failed=0

]
========== FAIL ==========
[Error:
PLAY [all] ********************************************************************

GATHERING FACTS ***************************************************************
<172.17.42.1> ESTABLISH CONNECTION FOR USER: root
<172.17.42.1> REMOTE_MODULE setup
<172.17.42.1> EXEC ssh -C -vvv -o ControlMaster=auto -o ControlPersist=60s -o ControlPath="/root/.ansible/cp/ansible-ssh-%h-%p-%r" -o Port=2200 -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o ConnectTimeout=10 172.17.42.1 /bin/sh -c 'LANG=en_US.UTF-8 LC_CTYPE=en_US.UTF-8 /usr/bin/python'
fatal: [172.17.42.1] => SSH Error: data could not be sent to the remote host. Make sure this host can be reached over ssh

TASK: [create a file] *********************************************************
FATAL: no hosts matched or all hosts have already failed -- aborting

PLAY RECAP ********************************************************************
           to retry, use: --limit @/root/example.retry

172.17.42.1                : ok=0    changed=0    unreachable=1    failed=0

]
4rzael commented 8 years ago

This problem comes from pheromon, not 6brain.

We need to append theses lines in /etc/ssh/sshd_config on the server:

# In order to enable reverse SSH from sensor to docker
AllowTcpForwarding yes
GatewayPorts yes

Then restart the ssh server

sudo service ssh restart
vallettea commented 8 years ago

@4rzael you mean you managed to solve the problem of the update ? should I add this to the server ?

4rzael commented 8 years ago

I still have an error, but it allows the docker to connect to the sensor.

vallettea commented 8 years ago

awesome. Just changed the ssh config on the server

4rzael commented 8 years ago

Okay, it should work.

4rzael commented 8 years ago

Changing the configuration file on the server fixed this.