tmate live-forever session

1,073 views
Skip to first unread message

Yifan Zhang

unread,
Sep 13, 2015, 8:56:04 AM9/13/15
to tmate.io
Hi,

I just find out about tmate now, and it looks really good. The question is that I don't plan to use this to share sessions with others. Instead, I would like to use this as a ssh serve alternative, to allow me access to my server outside the firewall. Currently if I disconnect and reconnect, I will get a message saying the session has expired. Is there a way to run tmate as what I described above? Thanks in advance.

Nicolas Viennot

unread,
Sep 13, 2015, 1:52:23 PM9/13/15
to Yifan Zhang, tmate.io
Soon (within 3 months).

In the meantime, you can detach from the session (either through the tmux binding, or killing your ssh session) instead of exiting the shell.

On Sun, Sep 13, 2015 at 8:56 AM, Yifan Zhang <freq...@gmail.com> wrote:
Hi,

I just find out about tmate now, and it looks really good. The question is that I don't plan to use this to share sessions with others. Instead, I would like to use this as a ssh serve alternative, to allow me access to my server outside the firewall. Currently if I disconnect and reconnect, I will get a message saying the session has expired. Is there a way to run tmate as what I described above? Thanks in advance.

--
You received this message because you are subscribed to the Google Groups "tmate.io" group.
To unsubscribe from this group and stop receiving emails from it, send an email to tmate-io+u...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

l.lem...@gmail.com

unread,
Apr 19, 2016, 4:17:35 PM4/19/16
to tmate.io, freq...@gmail.com
Hi,

I'm using tmate with the same goal : as a ssh server, since I can't do port-forwarding.

Meanwhile, I have a strange behavior : I have a running tmate daemon. When I issue "tmate -S /tmp/tmate.sock display -p '#{tmate_ssh}'", it returns a socket @fk2.tmate.io, and when I try to connect to it, it says that the token is invalid or has expired !

The "api" call result is :
{"ws_url_fmt":"wss://fk2.tmate.io/ws/session/%s","ssh_cmd_fmt":"ssh %s...@fk2.tmate.io","created_at":"2016-04-18T20:55:37.399887Z","closed_at":null}

Saying that the socket hasn't been closed, but it seems to be !?

I'm trying to make a script to always have a tmate socket opened, but it's difficult with "dead" sockets ;)

Nicolas Viennot

unread,
Apr 19, 2016, 4:26:44 PM4/19/16
to l.lem...@gmail.com, tmate.io, freq...@gmail.com
Since the master server did not see the session close, I'm guessing there has been some network failure between the fk2 server and the master server.
If you are using tmate 2.2.1, you will get reconnections out of the box, so if the tmate client gets disconnection for whatever reason, it will reconnect and your session token will remain valid (but may be on another server).
If it helps, you can use webhooks: https://github.com/tmate-io/tmate/wiki/Webhooks
You should be able to get a "always available" ssh session this way.

Ludovic Lemarinel

unread,
Apr 19, 2016, 4:29:36 PM4/19/16
to Nicolas Viennot, tmate.io, freq...@gmail.com
Strange... I already use tmate 2.2.1 :(

Nicolas Viennot

unread,
Apr 19, 2016, 4:43:40 PM4/19/16
to Ludovic Lemarinel, tmate.io, freq...@gmail.com
Hum.... that's a bug then. The reconnection protocol should be working.
I'd be happy to debug what's going on.
Can you run tmate with "-v" next time? (careful, it may generate large amount of logs in some *.log files)

Ludovic Lemarinel

unread,
Apr 20, 2016, 2:47:33 AM4/20/16
to Nicolas Viennot, tmate.io
Hehe ! Again the same bug this morning : https://tmate.io/api/t/srspxibxCV3OdPvxvaW07V0oA

But I didn't had the chance to run tmate with -v :(

Nicolas Viennot

unread,
Apr 20, 2016, 2:54:11 AM4/20/16
to Ludovic Lemarinel, tmate.io
Argh!
Try with -v, and let's see the logs, hopefully this will help the debugging, because the issue is happening client side :(
Reply all
Reply to author
Forward
Message has been deleted
0 new messages