Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

tmate : Error connecting: Socket error: disconnected #73

Open
alnhk opened this issue Apr 17, 2020 · 4 comments
Open

tmate : Error connecting: Socket error: disconnected #73

alnhk opened this issue Apr 17, 2020 · 4 comments

Comments

@alnhk
Copy link

alnhk commented Apr 17, 2020

We are using this docker image - tmate/tmate-ssh-server:latest, and started on kubernetes using below

        - name: HAS_WEBSOCKET
          value: "0"
        - name: USE_PROXY_PROTOCOL
          value: "1"
        - name: SSH_HOSTNAME
          value: "localhost"
        - name: SSH_PORT_LISTEN
          value: "2224"
        - name: SSH_KEYS_PATH
          value: "/etc/tmate-keys"

And also started kubernetes service with load balancer. On the other machines, we configured to have ~/.tmate.conf to have this value :

set -g tmate-server-host af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com
set -g tmate-server-port 2224
set  tmate-authorized-keys "~/.ssh/authorized_keys"

on kubernetes pod where tmate/tmate-ssh-server:latest is running, it shows this :

Loading key /etc/tmate-keys/ssh_host_rsa_key
Accepting connections on :2224

However, when we trigger "tmate -F" from other machine, we encounter this below issue , we are using latest 2.4.0 as tmate version:

Error connecting: Socket error: disconnected
Reconnecting...
Connecting to af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com...
Error connecting: Socket error: disconnected
Reconnecting...
Connecting to af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com...
Error connecting: Socket error: disconnected
Reconnecting...
Connecting to af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com...
Error connecting: Socket error: disconnected
Reconnecting...
Connecting to af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com...
Error connecting: Socket error: disconnected
Reconnecting...
Connecting to af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com...
cError connecting: Socket error: disconnected

Can any one please share what exactly cause this issue but when we test using telnet, it goes fine :

telnet af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com 2224
Trying 24.118.90.163...
Connected to af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com.
Escape character is '^]'.
@alnhk
Copy link
Author

alnhk commented Apr 17, 2020

Further debug logs when executing "tmate -F -x"

Looking up af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com...
Connecting to af40f9f34d8b04b5df19dc9a7632-1754039.us-west-2.elb.amazonaws.com...
[1] [local_parse_file] local_parse_file: Cannot find file ssh_config.d/* to load
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: ForwardX11Trusted, line: 63
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: SendEnv, line: 65
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: SendEnv, line: 66
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: SendEnv, line: 67
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: SendEnv, line: 68
[1] [local_parse_file] local_parse_file: Cannot find file /etc/ssh/ssh_config.d/* to load
[1] [local_parse_file] local_parse_file: Cannot find file /etc/ssh/ssh.d/* to load
[2] [ssh_connect] ssh_connect: libssh 0.9.0 (c) 2003-2019 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading (null)
[2] [ssh_socket_connect] ssh_socket_connect: Nonblocking connection socket: 6
[2] [ssh_connect] ssh_connect: Socket connecting, now waiting for the callbacks to work
[1] [local_parse_file] local_parse_file: Cannot find file ssh_config.d/* to load
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: ForwardX11Trusted, line: 63
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: SendEnv, line: 65
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: SendEnv, line: 66
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: SendEnv, line: 67
[2] [ssh_config_parse_line] ssh_config_parse_line: Unapplicable option: SendEnv, line: 68
[1] [local_parse_file] local_parse_file: Cannot find file /etc/ssh/ssh_config.d/* to load
[1] [local_parse_file] local_parse_file: Cannot find file /etc/ssh/ssh.d/* to load
[2] [ssh_connect] ssh_connect: libssh 0.9.0 (c) 2003-2019 Aris Adamantiadis, Andreas Schneider and libssh contributors. Distributed under the LGPL, please refer to COPYING file for information about your rights, using threading (null)
[2] [ssh_socket_connect] ssh_socket_connect: Nonblocking connection socket: 8
[2] [ssh_connect] ssh_connect: Socket connecting, now waiting for the callbacks to work
[1] [socket_callback_connected] socket_callback_connected: Socket connection callback: 1 (0)
[1] [ssh_socket_exception_callback] ssh_socket_exception_callback: Socket exception callback: 1 (0)
[1] [ssh_socket_exception_callback] ssh_socket_exception_callback: Socket error: disconnected
SSH client killed (24.118.90.163)
[1] [socket_callback_connected] socket_callback_connected: Socket connection callback: 1 (0)
[1] [ssh_socket_exception_callback] ssh_socket_exception_callback: Socket exception callback: 1 (0)
[1] [ssh_socket_exception_callback] ssh_socket_exception_callback: Socket error: disconnected
Error connecting: Socket error: disconnected
SSH client killed (31.165.117.81)

@alnhk
Copy link
Author

alnhk commented Apr 17, 2020

@nviennot : Please expedite.

@repomaa
Copy link

repomaa commented Jul 4, 2020

Having the same issue. The server shows:
fatal: Cannot create new namespace

@mehdihz
Copy link

mehdihz commented Jan 19, 2021

Having the same issue. The server shows:
fatal: Cannot create new namespace

This happened because of SYS_ADMIN capability missing. Run docker with the below config to fix the issue:
docker run --cap-add SYS_ADMIN -v /etc/tmate/keys:/etc/tmate/keys -e SSH_KEYS_PATH='/etc/tmate/keys' -p 2200:2200 -d tmate/tmate-ssh-server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants