jeroenpeeters / docker-ssh

SSH Server for Docker containers ~ Because every container should be accessible
GNU General Public License v2.0
638 stars 89 forks source link

ssh tunnel warning #15

Closed ecerroni closed 7 years ago

ecerroni commented 7 years ago

Although I think it's a configuration server issue I'm posting it here anyway as I think it might be common case I'm looking to solve here:

Every time I try to ssh to the container through the remote host I'm getting the following warning:

@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ @ WARNING: REMOTE HOST IDENTIFICATION HAS CHANGED! @ @@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@@ IT IS POSSIBLE THAT SOMEONE IS DOING SOMETHING NASTY! Someone could be eavesdropping on you right now (man-in-the-middle attack)! It is also possible that a host key has just been changed. The fingerprint for the RSA key sent by the remote host is 36:e1:fc:d8:be:10:8a:26:d9:d1:e6:1f:aa:78:cf:93. Please contact your system administrator. Add correct host key in /home/rico/.ssh/known_hosts to get rid of this message. Offending ECDSA key in /home/rico/.ssh/known_hosts:31 remove with: ssh-keygen -f "/home/rico/.ssh/known_hosts" -R [163.172.171.82]:33 RSA host key for [163.172.171.82]:33 has changed and you have requested strict checking. Host key verification failed.

I can't establish the ssh tunnel. Any advice?

ecerroni commented 7 years ago

Got further with -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no but then the connection closes immediately.

Here there is the error:

docker-ssh_1  | [2016-09-14T19:30:16.761Z] ERROR: noAuthHandler/31 on 9055549788ac: NoAuthentication handler is handling the authentication! This is INSECURE!
docker-ssh_1  | [2016-09-14T19:30:17.078Z]  INFO: sessionHandler/31 on 9055549788ac: Opening shell (container=rethinkdb)
docker-ssh_1  | [2016-09-14T19:30:17.098Z] ERROR: sessionHandler/31 on 9055549788ac: (container=rethinkdb)
docker-ssh_1  |     Exec error { Error: connect ENOENT /var/run/docker.sock
docker-ssh_1  |       at Object.exports._errnoException (util.js:953:11)
docker-ssh_1  |       at exports._exceptionWithHostPort (util.js:976:20)
docker-ssh_1  |       at PipeConnectWrap.afterConnect [as oncomplete] (net.js:1080:14)
docker-ssh_1  |     
docker-ssh_1  |       code: 'ENOENT',
docker-ssh_1  |       errno: 'ENOENT',
docker-ssh_1  |       syscall: 'connect',
docker-ssh_1  |       address: '/var/run/docker.sock' }
docker-ssh_1  | [2016-09-14T19:30:17.191Z]  INFO: sshServer/31 on 9055549788ac: Client disconnected (clientIp=24.135.46.229)
jeroenpeeters commented 7 years ago

This error indicates that /var/run/docker.sock doesn't exist. Did you map it into the container like so /var/run/docker.sock:/var/run/docker.sock ?

ecerroni commented 7 years ago

It worked! You were right, there was a typo in my docker-compose.yml